Create executable jar

Started by Mago_Pagliaccio, January 21, 2009, 17:44:49

Previous topic - Next topic

Mago_Pagliaccio

Hello everyone!
It's the first time I use the lwjgl, because I'm working on a project of computer graphics for my university.
The game is quite ready, it works fine when I run it in eclipse, and now I should create and executable jar, but I'm having a lot of troubles!
I create the jar using the Fatjar plugin for eclipse, but when I run the jar it gives me back:

java.lang.unsatisfiedlinkerror: no lwjgl in java.library.path

I've made an extensive research on google, and I've also tried what proposed in this post http://lwjgl.org/forum/index.php/topic,1405.0.html
In this case, NOTHING happens. Nor sign of life, neather errors...

I'm pretty lost.
I hope someone has some suggestions.

Thank you!

broumbroum

hi !
Where do you put the lwjgl library ? for windows and Mac it should be ok within the current directory of your .jar if running on Linux, I think you can add the -Djava.library.path=. option to launch it.

Mago_Pagliaccio

I'm under Windows, and I have it in my current directory; when I create the executable jar I check also the name of the lwjgl library in the list of the files to include.
I've also tried to add the -Djava.library.path= both in the VM parameters in eclipse and in the command line, but nothing changes.
Any suggestion?
Thank you!

broumbroum

Are you packing the .dll lib in the jar ?? .dll must be unpacked in the CWD at runtime or before.

Mago_Pagliaccio

It works!
I was packing it, but now I have it in the CWD and it works! Thank you very much!

Related to this topic, is there any way to add the options so that there is no need to launch it via command line, but double-clicking?
I mean, my game requires -XX:MaxDirectMemorySize=1024M to work, how can I force it so that the user can just click on the jar and run the game?

Thank you!

broumbroum

jSmooth is the best wrapper for Windows Java applications. You should be able to set up your app very quickly. ;) On Linux, you have to change the .jar access permission with the "executable" flag on.

Mago_Pagliaccio

Jsmooth is a good suggestion, thank you!
Otherwise, I've found that it is possible to make it work with a batch script that calls the jar and sets the options.

Thank you again, my project now works thanks to you!  :D