jar a project and native files

Started by mhatzitaskos, October 23, 2005, 11:18:16

Previous topic - Next topic

mhatzitaskos

hi, i created a game with java and lwjgl.

I used -Djava.library.path when I compiled and run the game when I was
developing it, but now I want to compile everything into a jar file.
However, when I do that java doesnt find the native files.

My project has the following folders:
/classes/  my classes and the main class
/native/  the native lwjgl files
/sounds/  sounds of the game
/images/ images of the game
/libs/   libraries, such as the lwjgl

In the manifest of the jar i can specify the classpath but not the
library.path....
Even if I leave the /native/ and /libs/ folders outside the .jar file,
it still doesnt work. Can you please help me?

I cant have people running my game through command prompt :(
i want excecutable jars.

Please help,
regards,
Markos

Optus

Avoid command prompt, batch files and executable jars.  Executable Jars depend upon Windows' built-in registry setting to decide what will open them.  Since .JAR is actually just a zip file, some archiving programs will assume control of that file association.  Thus, in some cases, your game can't be run just by executing the jar.  I would check out JSmooth http://jsmooth.sourceforge.net.  It can create regular old executables (.exe) that can automatically detect any JREs on the computer, and run your game. All without setting a java_home variable, command lines, nasty batch files or anything like that.  If they don't have a suitable version of Java, it will redirect them to a website to download it.  You can even tell JSmooth to bundle the JVM with your game, and never worry about the user needing to install Java ever again.

Fool Running

Wow! :shock: I didn't know something like that existed.  I can ditch my batch files now.  :lol:
Thank you!
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

elias4444

I'd also have to recommend launch4j (launch4j.sf.net). I've used both that and JSmooth, and although JSmooth is easier, launch4j has a much broader range of options and has also been actively developed.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com