Running Java 6 Applet on Mac OS X Leopard

by Aleksejs

About year ago Apple released Java SE 6 for Mac OS X. But still Java SE 6 is available only for 64-bit Intel based Mac users, who uses Mac OS X Leopard. And still you can’t run Java 6 applets in your Safari, Firefox or Camino, because these browser are 32-bit applications and they can use 64-bit Java 6.

But I found some solution for me. I hope it will be useful for you too.

Command line tool appletviewer

There is a command line tool appletviewer in JRE. All you need, is type in terminal:

appletviewer http://www.example.com/applet.html

Note: If Java SE 6 is not default for Java applications, then you need use full path:

/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/appletviewer http://www.example.com/applet.html

Java Policy

If the applet crashes with an execption java.security.AccessControlException: access denied, then you need to create .java.policy file in your home directory with contents:

grant {
permission java.security.AllPermission;
};

and try again to launch appletviewer.

Note: You can use policytool to manage this file, if you create custom security policy. Here is tutorial.

Note: Agree with Jason Petersen. If you will leave policy file like it is in example, it will provide uncontrolled access to any applet. Please follow tutorial to more detailed access control.