I don't know if this counts as a bug

Started by kensclark15, November 07, 2011, 04:30:42

Previous topic - Next topic

kensclark15

I really need help on this. I made a simple program. I included the org folder in lwjgl.jar with my Game.jar folder. I also added all of the Linux natives to it. My manifest looks like this: Manifest-Version: 1.0
Main-Class: me.kenneth.Main

It will not run no matter what I do. I DO NOT want to use any programs like JarSplicer or anything. Is there a way I can build a launcher class and make it use the natives some how?

CodeBunny

This is a fairly common question. Basically, you can't keep the natives in the jar and run the program. It's just not how it works. The dlls are required by the OS, not by the JVM. You need to have the operating system load them and then utilize them. However, the OS cannot load native libraries from within a Jar. They need to somehow be in the main filesystem first.

A method that I would recommend is to keep the natives in the jar, at startup extract them to a known directory, and then set the lwjgl system property to point to that folder. To put your program on a users computer, all they need to do is download the JAR file, and everything works with a minimum of fuss.