Problems testing jme

well i finally could compile jme files, but when i try the codes:


java -Djava.library.path=./lib -cp ./lib/lwjgl.jar;./lib/jogg-0.0.5.jar;./lib/jorbis-0.0.12.jar;./target/jme.jar;./target/jme-effects.jar;./target/jme-model.jar;./target/jme-sound.jar;./target/jme-terrain.jar;./target/jmetest.jar;./target/jmetest-data.jar



it give me back a thing telling the usage of java command and some options :?

also when i try this other one:

java -Djava.library.path=./lib -cp ./lib/lwjgl.jar;./lib/jogg-0.0.5.jar;./lib/jorbis-0.0.12.jar;./target/jme.jar;./target/jmetest.jar;./target/jmetest-data.jar jmetest.effects.TestDynamicSmoker



it sends an error telling:

Exception in thread "main" java.lang.NoClassDefFoundError: com/jmex/effects/particles/ParticleMesh

I'm using jdk1.5.0_09

thanks

the first command doesn't specify what class you want to run.



the second command is missing some jme-XXXXX.jar classes in the class path.

well te codes I where using were the ones in the guide from this website, between I finished getting how to work it:


java -Djava.library.path=./lib -cp ./lib/lwjgl.jar;./lib/jogg-0.0.5.jar;./lib/jorbis-0.0.12.jar;./target/jme.jar;./target/jmetest.jar;./target/jmetest-data.jar;[b]./build/[/b] jmetest.effects.TestDynamicSmoker



it works perfectly now.
-yuki- said:

well te codes I where using were the ones in the guide from this website, between I finished getting how to work it:

java -Djava.library.path=./lib -cp ./lib/lwjgl.jar;./lib/jogg-0.0.5.jar;./lib/jorbis-0.0.12.jar;./target/jme.jar;./target/jmetest.jar;./target/jmetest-data.jar;[b]./build/[/b] jmetest.effects.TestDynamicSmoker



it works perfectly now.


I checked out the code from the CVS server, opened a terminal and cd'ed to my jme path: ~/jme/jme


Then I tried to start the first sample file by running: java -Djava.library.path=./lib -cp ./lib/lwjgl.jar:./lib/jogg-0.0.7.jar:./lib/jorbis-0.0.15.jar:./target/jme.jar:./target/jme-awt.jar:./target/jme-effects.jar:./target/jme-model.jar:./target/jme-sound.jar:./target/jme-terrain.jar:./target/jmetest-data.jar jmetest.effects.TestDynamicSmoker

(Here I already replaced all ";" with ":" and entered the most recent versions for jogg and jorbis.)

And all it comes up with is: Exception in thread "main" java.lang.NoClassDefFoundError: jmetest/effects/TestDynamicSmoker

After that I added ":./build/" to the classpath and everything worked :) Maybe the "Getting Started" pages could have this added? ;)

I've a good suggestion for all this mess:

copy all .jar's to <jdk path>/jre/lib/ext/

copy all .dll's (for windows), .jnilib's (for mac) or .so's (for linux) to your java library path. (In linux and mac this is /usr/lib, for windows I don't know)



Next you can execute your classes just with

java classname

Both of the above solutions have a very serious shortcoming: they "save" you from having to think about which classes are on your class path, and which are not.

While this may look like a good thing at first, because you really want to make a cool game, not bother about how jME/java magically make that possible for you, it is, in fact, a bad thing. You will painfully notice that once you want to show off your cool game to a friend, on their computer. It can get really tedious to explain to your standard issue non-computer-geek how they find out where their jdk's ext/ directory is, or how they identify those ".jar" files you keep talking about!



After all the preaching, now here's a somewhat more "correct" solution to your troubles: instead of adding the ./build directory to the class path, as Teradil suggests, try adding jars from the target folder, until the application runs for you. This also gives you a first impression of how jME is organized into different jar files.

Note that I only use this method on my development computer, because that's a lot easier, I don't have to type the whole classpath each time I've modified something, and I don't need to modify anything in NetBeans, Eclipse, or any other IDE. I just compile with "javac *.java" and run with "java game". But on my computers where I test my game, I've to use a shell script, with all these libraries pre-included. Also, I ask some of my friends to test my game, and if they cannot run it, and I can run it on my development computer and not on my testing computer, I know something is wrong with the shell script. That means I can easily modify the shell script and send the modified version to my friends, without even having to explain where to find the ext directory, or even what was wrong.