Webstart Howto?

Hi all you lovely people.



quite possibly an extremely newbie question here… And yes, I know this isn't really a jME question as such.



But I'm wondering, how exactly would I deploy my little homecoded test app, using webstart?

well it's basicly the entire

<resources>

part of the .jnlp file that I'm not to sure about…

this is what I believe I should do, please correct me if I'm wrong…


  1. I would compile my class into .jar


  2. I would make the resources part of my look .jnlp something like this?


<resources>

<j2se version="1.5+"/>

<jar href="test.jar" main="true"/>

<extension name="test" href="http:[my server]/test.jnlp" />

</resources>

<property key="java.library.path" value="." />

<application-desc main-class="test.JNLPtest.TestofTest.java"/>


But now I become just a bit confused, because I know that my .jar only contains my test class. Which for starters atleast means no lwjgl in there... so would I what? recompile and put lwjgl in there? or would I compile the jME source into another .jar... and download that along with my little test? or what?
and yes, I'm pretty green with respect to both Java, webstart and jME... which is possibly why I'm so confused about this whole thing..

thanks in advance for all replys :)

I use two jnlp files, because the lwjgl.jar comes pre-signed, and using two different signatures in the same file made problems.



I create the the native jars like linux-native.jar myself, they simply contain the dll (windows) or .so (linux) libraries without any directory structure.



main jnlp:


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
      codebase="http://www.stardust.ch/webstart"
      href="2008.jnlp">

  <information>
    <title>HappyNewYear</title>
    <vendor>Your Name</vendor>
    <homepage href="http://www.stardust.ch"/>
    <description>Happy New Year</description>
    <description kind="short">Happy New Year.</description>
    <offline-allowed/>
  </information>

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

  <resources>
    <jar href="2008.jar"/>
    <jar href="jme.jar" />
    <jar href="jme-awt.jar" />
    <jar href="jme-font.jar" />
    <jar href="jme-scene.jar" />
    <jar href="jme-terrain.jar" />
    <jar href="jme-effects.jar" />
    <extension name="lwjgl" href="lwjgl.jnlp"/>
    <jar href="jogg-0.0.7.jar" />
    <jar href="jorbis-0.0.15.jar" />
  </resources>

  <resources os="Windows">
     <j2se version="1.6+"/>
    <nativelib href="win-native.jar"/>
  </resources>
  <resources os="Mac OS">
    <j2se version="1.5+"/>
    <nativelib href="mac-native.jar"/>
  </resources>
  <resources os="Linux" arch="i386">
    <j2se version="1.5+"/>
    <nativelib href="linux-native.jar"/>
  </resources>
  <application-desc main-class="HappyNewYear"/>
</jnlp>



lwjgl.jnlp


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
      codebase="http://www.stardust.ch/webstart"
      href="lwjgl.jnlp">

  <information>
    <title>lwjgl</title>
    <vendor>Your Name</vendor>
  </information>
  <component-desc/>

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

  <resources>
    <jar href="lwjgl.jar"/>
  <resources/>

</jnlp>



start it up

Yep, there's definitely something, possibly something very very basic, that I'm not getting here,  cause my app just fails to run…



Umm… say I wanted to deploy HelloNode, from the jmetest.ToturialGuide package, using webstart… my exact steps would be? interms of compiling what to what, and so on?



A step by step guide would be nice :slight_smile:

At the risk of sounding extremely stupid in a moment… Here's what I think I'm supposed to do to for above task.



Using eclipse, I compile and pack up HelloNode.java, into HelloNode.jar

I then make som packing of the lwjgl native files into win/mac/linux-native.jars… and pack these into lwjgl.jar, so that lwjgl.jar… contains 3 jars, which hold the native librarys…

lwjgl.jar

    - win-native.jar

    - mac-native.jar

    - linux-native.jar

(already this is bugging me… I'm thinking:"what about the lwjgl java classes?"… And again, what about the classes that HelloNode uses?)



Anyways.

I make a seperate .jnlp lwjgl.jnlp


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
      codebase="http://[my server]/webstart"
      href="lwjgl.jnlp">

  <information>
    <title>lwjgl</title>
    <vendor>Darklighter</vendor>
  </information>
  <component-desc/>

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

  <resources>
    <jar href="lwjgl.jar"/>
  <resources/>


which is just a slightly modified version of the code posted by Core-Dump

then I make the main .jnlp: HelloNode.jnlp


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
      codebase="http://[my server]/webstart"
      href="HelloNode.jnlp">

  <information>
    <title>HelloNode</title>
    <vendor>Darklighter</vendor>
    <homepage href="http://[my server]"/>
    <description>A test</description>
    <description kind="short">test</description>
    <offline-allowed/>
  </information>

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

  <resources>
    <jar href="HelloNode.jar"/>
    <extension name="lwjgl" href="lwjgl.jnlp"/>
  </resources>

  <resources os="Windows">
     <j2se version="1.6+"/>
    <nativelib href="win-native.jar"/>
  </resources>
  <resources os="Mac OS">
    <j2se version="1.5+"/>
    <nativelib href="mac-native.jar"/>
  </resources>
  <resources os="Linux" arch="i386">
    <j2se version="1.5+"/>
    <nativelib href="linux-native.jar"/>
  </resources>
  <application-desc main-class="jmetest.TutorialGuide.HelloNode"/>
</jnlp>



and then I upload the four files to the server, and ofcourse it doesn't run, but it's the "why" I don't know... I think it has something to do with the things that bug me(look above) but what I'm actually supposed to do, I don't really know?

Core-Dump said:

heya,

you don't need to pack the native-jars into another jar.
In your jnlp file, you refer directly to those single native-jars.

What is also missing in your main jnlp file, are the jme / jogg etc. jars.

i'll will create a step by step wiki entry as soon as i find some time.


Then... what's in the lwjgl.jar?

heya,


darklighter said:

I then make some packing of the lwjgl native files into win/mac/linux-native.jars... and pack these into lwjgl.jar, so that lwjgl.jar... contains 3 jars, which hold the native librarys...
lwjgl.jar
    - win-native.jar
    - mac-native.jar
    - linux-native.jar
(already this is bugging me... I'm thinking:"what about the lwjgl java classes?"... And again, what about the classes that HelloNode uses?)

you don't need to pack the native-jars into another jar.
In your jnlp file, you refer directly to those single native-jars.

What is also missing in your main jnlp file, are the jme / jogg etc. jars.

i'll will create a step by step wiki entry as soon as i find some time.

this is the lwjgl.jar that comes with jme.

It contains the java classes:

ord.lwjgl

ord.lwjgl.input

ord.lwjgl.openal

ord.lwjgl.opengl

etc.



windows/linux-native.jar contains the actual c libraries and no java code / classes

Ohh… right

I’m not a very good writer :)  but there -> Wiki: Webstart Step by Step



I wouldn’t mind if someone could add some more comments / explanation where needed, fix spelling and grammar errors or add a section on how to create a jar file in netbeans.  :wink:

NetBeans builds jar files by default, if you check WebStart in the project's settings in NetBeans6 you even get signed jars for your app and the required libraries.

Core-Dump said:

I'm not a very good writer :)  but there -> Wiki: Webstart Step by Step

I wouldn't mind if someone could add some more comments / explanation where needed, fix spelling and grammar errors or add a section on how to create a jar file in netbeans.  ;)



Its a pretty good guide. I think it should be on the first page of the Tutorial section in the WiKi also - so far I have been searching the forums for this thread, if I have wanted to do a webstart.