LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: nemamradfazole on March 27, 2010, 15:20:50

Title: Export
Post by: nemamradfazole on March 27, 2010, 15:20:50
I have LWJGL running in Eclipse, also a project there... and I want to export it (as .jar or something like that), so I can send it to other people and they can try running it without having to install LWJGL. How could I do that?
Title: Re: Export
Post by: nemamradfazole on March 29, 2010, 21:36:43
So I think I've made it. MyFile.jar should contain all the standard stuff (*.class and main-class manifest) plus *.class from LWJGL (which can be set under project's Properties > Java Build Path > Order and Export > added and checked lwjgl.jar and lwjgl_util.jar). Then when I run it (in this case it's Linux), it looks like
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:DirectoryWithNativeFiles && java -jar MyFile.jar
where DirectoryWithNativeFiles is a directory where *.so (or probably *.dll in Windows) were put. It can be even "." (just dot) if it's the actual directory, but it has to be put that way (-Djava.library.path=DirectoryWithNativeFiles doesn't work for me)!
Title: Re: Export
Post by: kappa on March 29, 2010, 21:41:15
hmm, looks like your going about it all wrong.

have a look at this example (http://kappa.dreamhosters.com/test/speedblazer.zip) on how you can distribute your game and run it using batch files (.bat on windows, .sh on mac/linux).

alternatively you can use java web start or applet to distribute your application.
Title: Re: Export
Post by: Matthias on March 29, 2010, 22:05:42
Creating a fat JAR is a bad idea. Don't include the content of other JAR files in your JAR - use the class path attribute in your manifest file or the resource tags in the JNLP file.
Title: Re: Export
Post by: nemamradfazole on March 31, 2010, 18:26:04
Thanks, javalwjgl, I'll do it your way. By the way good game, don't you use there a motion blur for the road?
Title: Re: Export
Post by: kappa on March 31, 2010, 19:01:36
Quote from: nemamradfazole on March 31, 2010, 18:26:04
Thanks, javalwjgl, I'll do it your way. By the way good game, don't you use there a motion blur for the road?

thanks, there is no motion blur atm.