Contents / Previous / Next


Applet Launcher

The JOGL Applet Launcher enables applets using JOGL (and OpenAL for spatialized audio via JOAL) without any manual installation of software on users' computers. Sample applet code:
<applet code="com.sun.opengl.util.JOGLAppletLauncher"
      width=600
      height=400
      codebase="./lib"
      archive="jogl.jar,gluegen-rt.jar,JOGLbase.jar">
   <param name="subapplet.classname" VALUE="JOGLbase">
   <param name="subapplet.displayname" VALUE="JOGLbase Applet">
   <param name="progressbar" value="true">
   <param name="cache_archive" VALUE="jogl.jar,gluegen-rt.jar,JOGLbase.jar">
   <param name="cache_archive_ex" VALUE="jogl.jar;preload,gluegen-rt.jar;preload,JOGLbase.jar;preload">
</applet>
 
The "archive" parameter to the applet tag must contain jogl.jar (and optionally joal.jar for JOAL if sound is used) and gluegen-rt.jar, as well as any jar files associated with your applet: "your_applet.jar".

The codebase directory on the server, which contains the applet's jar files, must also contain jogl.jar, gluegen-rt.jar, and all of the jogl-natives-*.jar and gluegen-rt-natives-*.jar files from the standard JOGL and GlueGen runtime distributions (provided in jogl-[version]-webstart.zip from the JOGL release builds and gluegen-rt-[version]-webstart.zip from the GlueGen runtime release builds).
The codebase of the applet is the location from which the JOGL native library used by the applet is downloaded, here the "lib" subdirectory:

www/jogl/lib> ls -w 100
gluegen-rt.jar                           JOGLbase.jar
gluegen-rt-natives-linux-amd64.jar       jogl.jar
gluegen-rt-natives-linux-i586.jar        jogl-natives-linux-amd64.jar
gluegen-rt-natives-macosx-ppc.jar        jogl-natives-linux-i586.jar
gluegen-rt-natives-macosx-universal.jar  jogl-natives-macosx-ppc.jar
gluegen-rt-natives-solaris-amd64.jar     jogl-natives-macosx-universal.jar
gluegen-rt-natives-solaris-i586.jar      jogl-natives-solaris-amd64.jar
gluegen-rt-natives-solaris-sparc.jar     jogl-natives-solaris-i586.jar
gluegen-rt-natives-solaris-sparcv9.jar   jogl-natives-solaris-sparc.jar
gluegen-rt-natives-windows-amd64.jar     jogl-natives-solaris-sparcv9.jar
gluegen-rt-natives-windows-i586.jar      jogl-natives-windows-i586.jar
The file JOGLbase.jar contains the local project (all classes in the JOGLbase directory):
jar cvf JOGLbase.jar *.class
Your jar file does not have to be signed when you use the AppletLauncher. The claim is the Sun MicroSystems signed the other jar files and your applet is "wrapped".

The JOGL (and optionally JOAL) natives are cached in the user's home directory (the value of the "user.home" system property in Java) under the directory .jogl_ext. The Java Plug-In is responsible for performing all other jar caching. If the JOGL installation is updated on the server, the .jogl_ext cache will automatically be updated. This technique requires that JOGL has not been installed in to the JRE under e.g. jre/lib/ext.

The caching open a security risk because the applet writes into the users home directory.

This approach using the AppletLauncher does not work with the appletviewer. You have to open up local security restrictions providing a local policy file (here called Write.jp):

grant {
  permission java.security.AllPermission;
};
You may use these permissions by calling the appletviewer as follows:
appletviewer -J-Djava.security.policy=Write.jp JOGLbase.html
Don't do this! At least not if you have an sensitive data stored on your machine.