Building & Running a jME3 App From Command Line

Greetings,



I’m trying to compile and run a Hello World jME3 app from command line but I’m having issues when I try to run it. I am using the following command:



java -cp ./;[root]jME3jme3dist;[root]jme3buildclasses;[root]jme3lib;[root]jme3 Main



Where [root] isn’t actually in the command, I have just removed my particular file path up to the jME3 directory.



When I run this command I get the popup where I choose the resolution and graphics library for jMonkey. When I press “OK” I get:



Oct 30, 2010 10:40:32 PM com.jme3.system.Natives extractNativeLib

WARNING: Cannot locate native library: windows/lwjgl64.dll

Oct 30, 2010 10:40:32 PM com.jme3.system.Natives extractNativeLib

WARNING: Cannot locate native library: windows/OpenAL64.dll

Exception in thread “main” java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException



Does anyone know why this is happening and how to correct it?



Thanks.



Matt

Just do “ant jar” to build jme3 and then “java -jar mygame.jar -cp lib/jMonkeyEngine3.jar” to start your game. Normally the jar files from the /lib/ directory of the distribution should be loaded via the manifest of jMonkeyEngine3.jar. You should not need to specify them but they should always reside in a “lib” folder relative to jMonkeyEngine3.jar

alternativley you have tu supply every library jme3 use, but using the ant buildscript included is far more elegant.

Thanks. I’m not sure how I didn’t try the simplest include from the beginning but I now have:



[my project structure]

myProject/build/Main.class



and



[default jME3 structure]

myLibs/jME3/dist/jMonkeyEngine3.jar

myLibs/jME3/dist/lib [which has those jar files normen mentioned]



Then running:



java -cp ./;C:myLibsjME3distjMonkeyEngine3.jar Main



correctly runs the program now without error. I just wanted to post that for anyone that stumbles upon this thread later.