Packaging and Deploying JME Applications

Hi all!



I'm using Eclipse IDE to develop a simple game that uses JME + JMEPhysics.



I've read the http://www.jmonkeyengine.com/wiki/doku.php?id=packaging_and_deploying_jme_applications article, but i still can't make my game run as an standalone app.



So, what am i doing?



java -classpath jme/lib/lwjgl_util_applet.jar:jme/lib/lwjgl.jar:jme/lib/junit-4.1.jar:jme/lib/jinput.jar:jme/lib/jorbis-0.0.15.jar:jme/lib/jogg-0.0.7.jar:jme/target/jmetest-data-model.jar:jme/target/jme-collada.jar:jme/target/jme-gamestates.jar:jme/target/jme-font.jar:jme/target/jme-editors.jar:jme/target/jmetest-data-cursor.jar:jme/target/jmetest.jar:jme/target/jme-audio.jar:jme/target/jme-scene.jar:jme/target/jme-xml.jar:jme/target/jme-model.jar:jme/target/jme.jar:jme/target/jmetest-data-sound.jar:jme/target/jmetest-data-skybox1.jar:jme/target/jmetest-data-texture.jar:jme/target/jme-awt.jar:jme/target/jmetest-data-images.jar:jme/target/jme-terrain.jar:jme/target/jme-effects.jar:jmephysics/release/jme-physics.jar:ode/odejava-jni.jar -Djava.library.path=jme/lib:jmephysics/release/lib:ode/lib -jar CorraPelaSuaVida.jar



Where CorraPelaSuaVida.jar is cleary my app :P

And what i want?

First make it run without the libs in the jar, after, put all in one jar with pre-specified classpath :)

Thanks for helping :P

What kind of error are you getting?

I'm getting the following exception:


Exception in thread "main" java.lang.NoClassDefFoundError: com/jmex/physics/util/SimplePhysicsGame
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)


But i've setted the correct classpath. I don't know what it could be.

Thanks :)

You are missing the jmephysics.jar fileā€¦ if you don't have it, you might have to create it yourself from your compiled files.

Nope, the jmephysics file is there. ( Take a better look at my first post )



The problem is that i can't specify java -jar plus -classpath. I ve to do it using the manifest.mf file.



I still having problems, but i'm getting there :slight_smile:

Why don't you just do it like this then:


java -cp all.jar;your.jar;jars.jar -Djava.library.path=blah your.main.Class


Solved.



I've created and dir called lib at the same dir where the .jar is located. As well as i have specified libs in META-INF/manifest.mf. Then ran with the following command:



java -Djava.library.path=lib -jar CorraPelaSuaVida.jar



Thanks you all!