How to launch a jME game with a BATCH file

Hi,



I would like to distribute my game and launch it with a BATCH file.



I made this BATCH file :


java -cp lib/jdom.jar;lib/jme.jar;lib/jme-awt.jar;lib/jme-collada.jar;lib/jme-editors.jar;lib/jme-effects.jar;lib/jme-font.jar;lib/jme-gamestates.jar;lib/jme-model.jar;lib/jme-scene.jar;lib/jme-sound.jar;lib/jme-terrain.jar;lib/jmetest.jar;lib/jmetest-data.jar;lib/jme-ui.jar;lib/lib/jinput.jar;lib/lib/jogg-0.0.7.jar;lib/lib/jorbis-0.0.15.jar;lib/lib/junit-4.1.jar;lib/lib/lwjgl_fmod3.jar;lib/lib/lwjgl_util_applet.jar;lib/lib/lwjgl.jar;lib/jme-bui.jar;lib/jme-bui-src.jar; core.Game



But, the game stop his execution :(


17 juin 2007 18:49:42 com.jme.app.BaseGame start
INFO: Application started.
17 juin 2007 18:49:42 com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
17 juin 2007 18:49:42 com.jme.system.PropertiesIO load
ATTENTION: Could not load properties. Creating a new one.
java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.lwjgl.Sys$1.run(Sys.java:75)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
        at org.lwjgl.Sys.loadLibrary(Sys.java:84)
        at org.lwjgl.Sys.<clinit>(Sys.java:101)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:108)
        at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(Unknown Source)
        at com.jme.app.AbstractGame.getAttributes(Unknown Source)
        at com.jme.app.BaseGame.start(Unknown Source)
        at core.Game.main(Game.java:24)
17 juin 2007 18:49:43 core.GameManager cleanup
INFO: Cleaning up resources.
17 juin 2007 18:49:43 com.jme.app.BaseGame start
INFO: Application ending.



In this log file, we can see that the lwjgl.jar is not find but the path is correct !

Any idea ?

FAQ:

http://www.jmonkeyengine.com/wiki/doku.php?id=the_faq



Q. It’s broken! All I get is this error: “java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path”

A. You must point the JVM to the native library for LWJGL. On Windows this is LWJGL.dll, Linux LWJGL.so, Mac OS X LWJGL.jnilib. There are a number of ways to “point” the JVM here. First, put the native library in a system directory, add the lib’s current directory to the PATH variable, or use the -Djava.library.path=[PATH TO LIB] JVM flag.

thank's a lot, it works !