LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Mago_Pagliaccio on January 21, 2009, 17:44:49

Title: Create executable jar
Post by: Mago_Pagliaccio on January 21, 2009, 17:44:49
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!
Title: Re: Create executable jar
Post by: broumbroum on January 22, 2009, 22:44:02
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.
Title: Re: Create executable jar
Post by: Mago_Pagliaccio on January 26, 2009, 11:14:42
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!
Title: Re: Create executable jar
Post by: broumbroum on January 26, 2009, 19:44:40
Are you packing the .dll lib in the jar ?? .dll must be unpacked in the CWD at runtime or before.
Title: Re: Create executable jar
Post by: Mago_Pagliaccio on January 27, 2009, 12:50:00
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!
Title: Re: Create executable jar
Post by: broumbroum on January 27, 2009, 19:43:19
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.
Title: Re: Create executable jar
Post by: Mago_Pagliaccio on January 27, 2009, 20:27:25
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