Compiling JME+ JME physics and our project in to a jar

hey guys,

so we've finished our game for our computer science class, and JME is kick ass. only problem is we can't seem to get it to run outside of eclipse!

we've tried alot of different ways of solving this, but none seem to do it.

so we are using JME, and JME physics, and ideally we want to run it all from a jar, or a set of jars.

is there one fool-proof way to do all of this??

please, any way to do this would be appreciated

thanks a ton,


You can try One Jar (make sure you read the section on native libraries)

Or the  Eclipse plugin based on it: Fat Jar.

Not sure the latter can handle native libraries though (placing them in the same dir as the jar should work however).

we've seen those.

alright the next best option for us is to just build all the files and turn it in. however, i've seen many ways to run a project using JME from the command line, but they seem to be for older versions of jme and jme physics, or just plain don't work. is there a way to just compile all the projects(we are using ant, and the eclipse generated build files) and then put the JME jars in a directory, and run it problem free?

in short we have no problem building everything, but once its built, it can't seem to see any of the lwjgl libs etc.



It's not hard to make your own jars. Just zip up all the class files that are in the build directories of your Eclipse projects. Add the other jars to that (such as LWJGL), place the native libraries in the same directory as the jars. Then you can start your program from the command line. Obviously you must make sure you put all the jars on the classpath!!! Also if you put the native libraries in a different directory add a -Djava.library.path too.

Of course it's not fun doing this by hand, that's why there are tools like Ant or Fat-Jar for this… I've used both Fat-Jar and One-Jar (through an ANT task) with succes for jME.

I've used both Fat-Jar and One-Jar (through an ANT task) with succes for jME.

I plan to use one-jar with jme. I was using one-jar on a former project (no 3D) and it worked fine.

i wonder how i should but the native path in my one-jar ant skript. It would be great if you could show me your ant skript.