starting a standalone LWJGL application via .bat or similar

Started by thatdude624, November 03, 2011, 10:45:47

Previous topic - Next topic

thatdude624

hi guys, I haven't worked on my java game for a long time, I have been a tad sideteacked with other major projects. now I am waiting for an order and have notihn to do, I remembered, I had a game. so now the game is at a point where it is almost bug-free, and I want to be able to give it to my freinds so they can make levels for it, but I cannot get the game to run outside of netbeans. this is probably very simple, but I do not know command prompt that well, or how to launch apps. here is what I tried:
java -jar "C:\magnet\game.jar" -Djava.library.path="C:\magnet\lwjgl\native\windows"

there are 2 problems with this:
1. it does not work. quite an important one.
2. the game must be located in that directory. is it possible to execute this relative to it's location?

I really do not care how it will launch, as long as it will work on windows.
sorry if this is a stupid question, but I really cannot figure it out. I greatly appreciate any help.
thanks in advance!

kappa

Have a read of the Distributing LWJGL Applications section of the LWJGL FAQ. The are a few choices mentioned there, including the option to creating just a single clickable Jar (using JarSplice) or turning your application into a single EXE file (Launch4J).

In any event, if you want to go pure batch script (.bat) way then you're probably looking for something along the lines of:

java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar;jar\jinput.jar; -Djava.library.path=native\windows org.lwjgl.test.WindowCreationTest