How do you set up the classpath in order to run the demos?


After sucessfully compiling the source code I'm having trouble running the demos using the command in the getting started guide.  How do I set my classpath in order to get past all of the NoClassDefFoundErrors?

Thank you in advance

C:>java -Djava.library.path=./lib -cp ./lib/lwjgl.jar;./lib/jogg-0.0.5.jar;./li
b/jorbis-0.0.12.jar;./target/jme.jar;./target/jmetest.jar;./target/jmetest-data.
jar jmetest.effects.TestDynamicSmoker
Exception in thread "main" java.lang.NoClassDefFoundError: jmetest/effects/TestD
ynamicSmoker

The jme-effects.jar is missing in your classpath.

In Linux I used:

java -Djava.library.path=./lib -cp ./lib/lwjgl.jar:./lib/jogg-0.0.5.jar:./lib/jorbis-0.0.12.jar:./jme.jar:./jmetest.jar:./jmetest-data.jar:./jme-effects.jar:./jme-model.j

ar:./jme-terrain.jar:./jme-ui.jar jmetest/TestChooser

You could go the simple route and just use Eclipse…but that might be too easy. :wink:



darkfrog

Not if you think Eclipse runs like a dog, which it does for me (Fedora Core 4 on AMD64 + 1Gb memory). Though I agree it is quite easy to setup.

Like a dog?  You must be doing something wrong then. :-p



You might give NetBeans a try though as they have some serious UI tweaks and supposedly it's straight-up swing though I find it hard to believe.



Eclipse 3.1 on JDK1.5 runs like a dream for me on Windows, FC4, and SuSE 9.3



darkfrog

Eclipse and NetBeans run like treacle on 32bit Core 4, with my AMD64, 1GB and GeForce 6600GT.

That seems very odd.  I set up a friend recently with a VERY similar configuration and he didn't have any problems with Eclipse.  Although he was running FC4 64-bit edition.



darkfrog

Not sure what I'm doing wrong:


[mike@localhost Demo08]$ java -Djava.library.path=./lib -cp ./lib/lwjgl.jar:./lib/jogg-0.0.5.jar:./lib/jorbis-0.0.12.jar:./jme.jar:./jmetest.jar:./jmetest-data.jar:./jme-effects.jar:./jme-model.jar:./jme-terrain.jar:./jme-ui.jar jmetest/TestChooser
Exception in thread "main" java.lang.NoClassDefFoundError: jmetest/TestChooser

try adding ".:" in front of your first cp entry and see if that helps.

No difference. This should be easy but I'm just not getting it.  :oops:



Thanks

I don't know what to tell you, you might simplify a bit by dropping the LWJGL natives in your path so it doesn't need to be explicitly referenced and just add the jme.jar and jmetest.jar to see if you can get past that error.



at that point you should just have to do:



java -cp .:lib/jme.jar:lib/jmetest.jar jmetest.TestChooser



hehe, while I was typing this out I figured out your problem…when you reference a class that is in a directory you need to reference it with a dot instead of a forward slash. :-p



Give that a try and I think you'll be on your way.



darkfrog

I'm not sure I understand what you mean.



Thanks again

You typed "jmetest/TestChooser" in the command-line but if you change it to "jmetest.TestChooser" I think you'll get a different result.



"." instead of "/"



darkfrog

Oh I see - no I tried that but it didn't work.

try exactly what I posted previously on the command-line

jmetest.TestChooser



If you mean that, I tried and it didn't work.

OK.I started this thread. I'm still having problems.

The real question myabe should have been, how do I correctly set the classpath in order to run the demos on a windows box?

  1. download source from cvs (see getting started)
  2. ant dist-all (see getting started)
  3. ant dist-test (see getting started)
  4. copy all dlls libraries from lib directory to jme (working) directory
  5. make test.bat file in jme (working) directory

    contents of test.bat:

    java -cp lib/jogg-0.0.5.jar;lib/jorbis-0.0.12.jar;lib/lwjgl.jar;lib/lwjgl_fmod3.jar;target/jme.jar;target/jme-effects.jar;target/jme-model.jar;target/jme-sound.jar;target/jme-terrain.jar;target/jme-ui.jar;target/jmetest.jar;target/jmetest-data.jar jmetest.TestChooser

    pause
  6. run test.bat


  • it works for me, at least first demo :slight_smile:

Step 4 is really not needed if you make use of -Djava.library.path={point to the lib dir}

without step 4 it doesnt work for me now, i try to solve the problem now :slight_smile:

(see thread http://www.jmonkeyengine.com/jmeforum/index.php?topic=2125.0)