Setting up jme 2 - am I doing it wrong?

Hi I'm new to using jME and recently went through the "getting started" section of the user's guide.



I prefer to program manually rather than use an IDE so I simpy downloaded the latest jME and set it up with Ant as described on my machine using the command line (I'm running Vista but currently it seems to be ok). The build seemed to produce no errors, but when I got to the testing attempting to execute the various built-in demos doesn't work.



I get the following error when trying to run "java -Djava.library.path=.lib jmetest.effects.TestDynamicSmoker" …







Exception in thread "main" java.lang.noClassDefFoundError: jmetest/effects/TestDynamicSmoker

Caused by: java.lang.ClassNotFoundException: jmetest.effects.TestDynamicSmoker

at java.net.URLClassLoader$1.run<Unknown Source>

at java.security.AccessController.doPriviledged<Native Method>

at java.net.URLClassLoader.findClass<Unknown Source>

at java.lang.ClassLoader.loadClass<Unknown Source>

at sun.misc.Launcher$AppClassLoader.loadCkass<Unknown Source>

at java.lang.ClassLoader.loadClass<Unknown Source>

Could not find the main class: jmetest.effects.TestDynamicSmoker. Program will now exit.







I presume this problem is something to do with the classpath parameter, "-cp", as I noticed after completing the build that the file structure wasn't quite as the user manual described (presumably that was for an older version). I tried at the time to accurately point to all the .jar files I could but I wasn't sure which ones were needed. Most notably, the manual repeatedly refers to "jogg" (with a version number) as a .jar file, which does not seem to be included anywhere in the package.



Unless anyone can immediately see what something I should be doing differently, could someone maybe give me a list of the specific .jar files I should include in my classpath (for the current 2.something version of jME), so I can try it again?

You try to execute the class jmetest.effects.TestDynamicSmoker, but java has no clue where that class could be.

You need to include the jme and lwjgl jars in your classpath.



see http://www.jmonkeyengine.com/wiki/doku.php/packaging_and_deploying_jme_applications? for an example

The classpath is really long on my machine, but I use eclipse, so im not really sure what you need.



At least I think you would need jme/bin, then all the lwjgl bindings and jinput.jar, jorbis.jar and maybe junit.jar.



Its much more hassle to go without eclipse, I would really suggest to use eclipse!

Hrhr, larynx uses "eclipse" synonymously with "IDE" :wink:



You will have to add the following to your classpath:



target/.jar

lib/lwjgl/
.jar

lib/lwjgl/native/windows/



(or mac or linux or whatever you use, replace "lwjgl" with "jogl" if you wanna use that)



lib/jorbis/jorbis-0.0.17.jar



If you want to use SWT, you have to add



lib/swt/windows



as well

Hrhr, larynx uses "eclipse" synonymously with "IDE" Wink

LOL, yes thats true - i like your attitude as your using NetBeans, or?  :D
I have to admit i only used eclipse for java dev until now, so i cant contend  :lol:

But my other convictions have been carefully crafted over time and experience, like:
Database=oracle (and not mysql)
ScriptLang=python (and not perl)
IfForcedToUse=C# (and not VB)
OS=Linux (and not Mac)
Playing: PS3 (and not X360)
:evil:

larynx said:

Hrhr, larynx uses "eclipse" synonymously with "IDE" Wink

LOL, yes thats true - i like your attitude as your using NetBeans, or?  :D


I'd have to assume that the guy writing a jME scene editor based on the NetBeans client platform is eating the 'Beans ;)

larynx said:

Playing: PS3 (and not X360)
}:-@


I guess PC gaming is truly dead if someone on a PC game engine's forum only mentions consoles  XD
I guess PC gaming is truly dead if someone on a PC game engine's forum only mentions consoles


The consoles have made ground big time in the last years, commercially spoken. The companies are just making more money with consoles, especially with PS3 (no mod chips). So the budgets for PC doesnt look too bright.

But i think JME is not an PC engine only, its java! JME3 runs on android! Yeah!
Hopefully sometime it will run on Wii, PS3 and X360, too.
larynx said:

LOL, yes thats true - i like your attitude as your using NetBeans, or?  :D

For cross-platform java and c/c++ stuff I use NetBeans, for OSX development using anything than XCode will cause problems sooner or later ;)

Open source and non-restriced development is on a general low these days with the most successful products in the decade being the exact opposite of open (iPhone?). But its something thats only expresses itself in monetary value. All those programmers doing our games in the future are surely not sitting at home with their freshly bought PS3 SDK right now.

But, as you pointed out, jme and java are just a platform and in fact it would be possible to use it on any system. Sony even uses bullet for many games and even put some money into developing Cell SPU support for it.. Good techniques for game development can be implemented on any platform ;)

Thanks for all the comments so far guys.



Strangely though, even using the classpath to include all .jar files in "target" and the jorbis one from "lib", I still get the same error - whether I try to use lwjgl or jogl. I would have expected to get a different error at the very least but it seems to be exactly the same one as listed in my topic starter… I guess I could try an IDE, but whilst I'm fiddling with that, are there any obvious flaws in what I'm doing?

You gotta build the tests separately, its another ant target, dont remember the name right now. dist-test or something?

normen said:

You gotta build the tests separately, its another ant target, dont remember the name right now. dist-test or something?


Really? That may explain a lot, although there currently are several .jar files with names beginning with jmetest in the "target" folder. I shall see what I can find out about those test files