How to use webstart with JMonkey?

1.

Hi, I have put my project into 1 jar by using fatjar eclipse plugin. But when I run the jar, the main class is started and i get the:



java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
....



I think it is thrown since some .dll's are not found since I got the same exception when I copied the windows workspace to linux and ran it with eclipse there and I had to point to linux natives in project setup.

There are only dll's in my fat.jar that begin with swt-... .dll. Why arent the native libs added to the fat.jar that are in the lib/lwjgl/native/win32?

2.
When I try to follow this http://www.jmonkeyengine.com/wiki/doku.php?id=jme_webstart_step_by_step step by step tutorial to JME webstart then in the beginning there is said that:

Prerequisites:
- You have the jME project checked out and successfully created the jme jars. (in jme/target folder)
- You have a working project, which you want to deploy using webstart.

I have JME checked out and I also have a working project, but I dont have any jars in jme/target folder. How can I make those?


Doing it the way that wiki article does should work. Just put the natives for whatever operating system into a jar on their own such as windows-native.jar



You should be able to select whatever you want to put in there using the standard eclipse jar creation - or just creating a .zip file and renaming it to .jar will probably work.

Tx,



now I got so far that I get the application started from .jnlp file, it changes the screen resolution and then it crashes. I don't know what causes this since I can't see any debugging information.



I have read that with webstart there are issues with resource allocation. So I quess my program doesen't find some files since they are put elsewhere.



Can anybody give me some hints about how to overcome this issue? And I would also like to know if it is possible to see console output of a webstart application?



My app is in here http://84.50.49.5/webstart/ and it starts from mains.jnlp.

[EDIT] since that server doesent have static IP, ive moved the webstart to http://betwixt.kirves.pri.ee/Pro/Java/gtas_webstart/web-main.jnlp [/EDIT]

Wohooo! I have solved my webstart problem!



1.

I looked at StarDust source and I added resource allocation locations to my main method:



    public static void main(String[] args) {
          try {
         ResourceLocatorTool.addResourceLocator(
                 ResourceLocatorTool.TYPE_MODEL,
                    new SimpleResourceLocator(GTASGameClient.class.getClassLoader().getResource(
                                 "data/models/md5/")));
         ResourceLocatorTool.addResourceLocator(
                 ResourceLocatorTool.TYPE_TEXTURE,
                    new SimpleResourceLocator(GTASGameClient.class.getClassLoader().getResource(
                                 "data/textures/")));
          
         ResourceLocatorTool.addResourceLocator(
                 ResourceLocatorTool.TYPE_AUDIO,
                   new SimpleResourceLocator(GTASGameClient.class.getClassLoader().getResource(
                                 "data/audio/")));
      } catch (URISyntaxException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
       
        GTASGame app = new GTASGame();
        app.setConfigShowMode(ConfigShowMode.AlwaysShow, GTASGame.class.getClassLoader().getResource("data/textures/splash.jpg" ));       
        app.start();
    }



2.
My webstart program still crashed. After extensive debugging with JOptionPane.showInputDialog("HERRE"); I discovered that program will crash if I have like:

private static final Logger logger = Logger.getLogger(HelloJMEDesktop.class.getName());
Texture t2 = TextureManager.loadTexture(
              TestTerrain.class.getClassLoader().getResource(
              "data/textures/Detail.jpg"),
              Texture.MinificationFilter.Trilinear,
              Texture.MagnificationFilter.Bilinear);

since HelloJMEDesktop isnt in the same jar as my main class. I had to change it to:

private static final Logger logger = Logger.getLogger(ClassThatIsInTheSameJarWhereMainMehodIs.class.getName());

Texture t2 = TextureManager.loadTexture(
              GTASGame.class.getClassLoader().getResource(
              "data/textures/Detail.jpg"),
              Texture.MinificationFilter.Trilinear,
              Texture.MagnificationFilter.Bilinear);

3. Oh and it really helped that I could run the deply webstart app from my pc with:


<jnlp spec="1.0+"
      codebase="file:///G:/Documents and Settings/Henri/Desktop/Webstart"
      href="mains.jnlp">



I read it from http://www.jmonkeyengine.com/jmeforum/index.php?topic=10585.0.

Glad you got it sorted :smiley:



In case you didn't figure it out, or for anyone who finds the thread on search, you can turn on the console in Java settings. Under windows that is control panel->java->advancaed tab->Java console. Similar equivalent on Mac and Linux.



Then you can see the console out put same as you would with a normal Java app or in the IDE.

Thank you Alric that was very informative. But I still have a minor issue. The textures of my md5 models are not found. The program runs but the character does not have texture. The ground and skybox have textures from files tough.



I think this happens because I have separate md5importer jar and when locationg the resources some MD5Importer classes are used to form the url I think like MD5Importer.class.getClassLoader().getResource(path). But I couldnt find the place in md5importer that actually deals with loading textures nor parsing the .md5mesh file. There are losts of abstract classes.