Login  Register

Re: JOGL applet deployment

Posted by nemesis on Jun 22, 2011; 5:27am
URL: https://forum.jogamp.org/JOGL-applet-deployment-tp3074893p3094224.html

I figured out how to make the applet path independent, so I thought I'd share.

You set "./" as the value for the codebase tag, and if all the files are in the same folder,
you can move the folder anywhere and the applet will still run.

The final jnlp files are as follow:

jogl.jnlp

*************************************************
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="./"
  href="jogl.jnlp">

  <information>
    <title>JOGL libraries</title>
    <vendor>JogAmp Community</vendor>
    <homepage href="http://jogamp.org/"/>
    <description>JOGL libraries</description>
    <description kind="short">All JARs and native libraries for JOGL.</description>
    <offline-allowed/>
  </information>
  <update check="background" policy="always"/>

  <security>
    <all-permissions/>
  </security>

  <resources>
    <jar href="gluegen-rt.jar" />
    <jar href="nativewindow.all.jar" />
    <jar href="jogl.all.jar" />
  </resources>

  <resources os="Windows" arch="x86">
    <nativelib href = "gluegen-rt-natives-windows-i586.jar" />
    <nativelib href = "jogl-natives-windows-i586.jar" />
    <nativelib href = "nativewindow-natives-windows-i586.jar" />
  </resources>
  <resources os="Windows" arch="amd64">
    <nativelib href = "gluegen-rt-natives-windows-amd64.jar" />
    <nativelib href = "jogl-natives-windows-amd64.jar" />
    <nativelib href = "nativewindow-natives-windows-amd64.jar" />
  </resources>
  <resources os="Windows" arch="x86_64">
    <nativelib href = "gluegen-rt-natives-windows-amd64.jar" />
    <nativelib href = "jogl-natives-windows-amd64.jar" />
    <nativelib href = "nativewindow-natives-windows-amd64.jar" />
  </resources>
  <resources os="Linux" arch="i386">
    <nativelib href = "gluegen-rt-natives-linux-i586.jar" />
    <nativelib href = "jogl-natives-linux-i586.jar" />
    <nativelib href = "nativewindow-natives-linux-i586.jar" />
  </resources>
  <resources os="Linux" arch="x86">
    <nativelib href = "gluegen-rt-natives-linux-i586.jar" />
    <nativelib href = "jogl-natives-linux-i586.jar" />
    <nativelib href = "nativewindow-natives-linux-i586.jar" />
  </resources>
  <resources os="Linux" arch="amd64">
    <nativelib href = "gluegen-rt-natives-linux-amd64.jar" />
    <nativelib href = "jogl-natives-linux-amd64.jar" />
    <nativelib href = "nativewindow-natives-linux-amd64.jar" />
  </resources>
  <resources os="Linux" arch="x86_64">
    <nativelib href = "gluegen-rt-natives-linux-amd64.jar" />
    <nativelib href = "jogl-natives-linux-amd64.jar" />
    <nativelib href = "nativewindow-natives-linux-amd64.jar" />
  </resources>
  <resources os="Mac OS X" arch="i386">
    <nativelib href = "gluegen-rt-natives-macosx-universal.jar" />
    <nativelib href = "jogl-natives-macosx-universal.jar" />
    <nativelib href = "nativewindow-natives-macosx-universal.jar" />
  </resources>
  <resources os="Mac OS X" arch="x86_64">
    <nativelib href = "gluegen-rt-natives-macosx-universal.jar" />
    <nativelib href = "jogl-natives-macosx-universal.jar" />
    <nativelib href = "nativewindow-natives-macosx-universal.jar" />
  </resources>

  <component-desc />
</jnlp>

******************************************************
applet jnlp

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="./"
  href="Viewer3DApplet.jnlp">

  <information>
    <title>Viewer3D</title>
    <vendor>Nemesis</vendor>
    <homepage href="http://jogamp.org/"/>
    <description>A 3D Viewer</description>
    <description kind="short">TestApplet</description>
    <offline-allowed/>
  </information>
  <update check="background" policy="always"/>

  <security>
    <all-permissions/>
  </security>

  <resources>
    <j2se href="http://java.sun.com/products/autodl/j2se/" version="1.4+"/>
    <j2se version="1.4+"/>
    <property name="sun.java2d.noddraw" value="true"/>
    <extension name="jogl" href="jogl.jnlp" />
    <jar href="viewer.jar" main="true"/>
  </resources>

  <applet-desc
      name="Viewer3Dapplet"
      main-class="com.Viewer3D.Viewer3D"
      width="700"
      height="600">
  </applet-desc>
</jnlp>

********************************************************

Wade, after you finish publishing your paper, could you please post the "advanced topic" on how to cut down
on jar sizes so that only the necessary files are downloaded?

Thanks again for all your help!