2

I'm looking for a way to export a JOGL program that I wrote. Currently, I am referencing four JAR files with a user library, and I specify -Djava.library.path=/lib as a VM argument. The /lib folder contains some Mac OS X .jnilib files that JOGL needs to work.

Everything runs well in Eclipse, but I need a way to export this setup to an executable JAR file. When I export it though, it only exports the JOGL.jars and not the .jnilibs.

How can I reference the .jnilibs so that the exported JAR file can use them?

I spent four or five hours doing the tutorial Creating native binary executables for multi-platform Java applications with OpenGL and Eclipse RCP which worked, but it's unnecessarily bloated for something that is supposed to be a small application.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user849170
  • 51
  • 3

2 Answers2

0

I use a program called JarSplice to store native files inside the JAR.

Oskar
  • 1,321
  • 9
  • 19
0

I don't think native libraries can be included in a JAR, they need to be available to the native OS to load and execute them. If they're in a JAR, the OS doesn't know what to do with that.

Here is one hackish way that might work.

Also see this SO post for other ideas.

Community
  • 1
  • 1
E-Riz
  • 31,431
  • 9
  • 97
  • 134