2

I have a java game using lwjgl and slick-util. It works perfectly on my computer, but not on anyone else's. It's packaged in a jar. I created the jar using Eclipse and sealed the natives and libraries with Jarsplice. The base Jar folder contains only package directories and natives, no manifests or classpaths. The game itself is not an Applet.

From my computer, this jar works and runs the game perfect. With anyone else's, it crashes as soon as the Display class is called in the main code (leaves an empty frame with the basic java name and icon and gray inner window). I have packed both the 32-bit and and the 64-bit natives and tested it on 32 bit and 64 bit windows systems alike, but the only one which runs it is mine (windows 32 bit).

The jar does not have a classpath or manifest in the base folder.

I renamed my eclipse build referenced folders, including the natives folder before running the jar, and it still worked. I do not have the natives anywhere else.

Here is the META-INF/MANIFEST.MF from within the jar. Note that the jar doesn't work on my computer either when I remove the Main-Class line. The class being referenced IS within the Jar.

 Manifest-Version: 1.0
 Launcher-VM-Args: 
 Launcher-Main-Class: processors.Main
 Main-Class: org.ninjacave.jarsplice.core.JarSpliceLauncher

Here is the directory structure within the jar:

   META-INF
   org
   game packages including processors
   all the natives.dll

Update: I have definately narrowed it down to the natives ONLY being detected by my machine, probably due to something I have installed. Maybe I'm missing something?

Sean
  • 254
  • 2
  • 10
  • I don't see any class folder corresponding to the package `processors`. What's your CLASSPATH set too on your local machine where the code works? – Perception Oct 25 '11 at 14:19
  • (game) just includes all the packages for my game, it's really 6 packages (processors, player, memory, etc) My CLASSPATH for windows is: .;C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip; – Sean Oct 25 '11 at 14:25
  • Ah, your using JarSplicer (as I can see from reading your question more carefully). Check out this thread, may be helpful - http://stackoverflow.com/questions/6749141/cant-start-jar-file-using-lwjgl. – Perception Oct 25 '11 at 14:48
  • I've already looked through that thread, that's how I learned about JarSplice :) I did all the steps right, I failed them and it didnt work on my machine before, but I got everything right now and it doesn't want to work on other computers. – Sean Oct 25 '11 at 14:56
  • I am researching using JNA instead of JarSplice, but I'll probably still need answers here. – Sean Oct 26 '11 at 15:26

1 Answers1

1

I solved this problem by packaging my resources, jar, and natives into a zip file together. Java automatically selects the folder the jar is in to find natives, as well as resources.

The Student
  • 27,520
  • 68
  • 161
  • 264
Sean
  • 254
  • 2
  • 10