Execute jME3 application with DOS

I have a problem with the libaries!

"java TestClass" does not work —> "NoDefClassFoundError"

How can I fix that?



In my second step I want to use the "ProcessBuilder" from java





Other question! I have a problem with a jar (jME3) file. I can execute it, but i get an OutOfMemoryError!

Is there any way to extend the max MemorySize inside the jar file? I don't want to write an extra bat file to execute a jar file, which is already executable!

Make sure all the libraries are there. If you build under netbeans, you need to include all the jars in the dist/lib directory along with jME in order for it to work.

you can starting it with

java -jar bla.jar -Xmx1024m



(notice that -jar has some side effects, there are better solutions like setting the -cp correct, just google it for details)

@Empire Phoenix

you can starting it with

java -jar bla.jar -Xmx1024m



That's exactly the thing I want to avoid! I know the DOS/script command, but any greenhorn non-programmer not! Therfore I would like a solution that's easy for the user, just one double click on the executable jar and the programm should run. There must be a way to include -Xmx1024m inside the METADATA of the jar file?





@Momoko_Fan

Not exactly what i want. Seems my question was bad and poorly verbalized. Let me ask a new question!



How can I make a runnable java application without Netbeans, Eclipse or any other programm, except the JavaRuntime?

The program is a jME3 demo application (you could say a small game), therefore jME3 libs have to be binded

There are no properties of a jar file that maps the arguments required to start a jvm. You can use java web start to achieve your goal (if you omit the codebase attribute of the jnlp element the jnlp descriptor will act as a local installer/launcher but it more common to have jws in the download page of the program).

hm you could use a small starter jar, using processbuilder using the above command then isntead of a .bat,

at least that way you maintain os independance.

Thx, Empire Phoenix, that's a good idea.

It's tricky and dirty, but i like it :wink:



Five months ago I created a java installer prototyp, which can recognize the os system.

If I modify it, I can use it as java starter

No .bat file or java installer is needed. Just pack all the libraries and jme into one jar and then double clicking it should launch the app.

the problem is not with Xmx1024m as most larger applications need it.