Hello.
I’m making a simple little test game with Jogl. I have set up the “Java Build Path” so that these two jar files are “Referenced Libraries”:
gluegen-rt.jar
jogl.jar
Then I have downloaded two DLL files and placed them in the project “root” folder (the folder that has the “src” and “bin” folders):
jogl.dll
jogl_awt.dll
With these two DLL files in that folder I am able to “Run” the game from Eclipse. However when I export the game as a “Runnable JAR file” the game will not start when I execute the jar file. If I place the two DLL files in the same folder as the jar file I can however run the game.
My operating system is Vista 64. I have realized those two DLL files are just for my OS. However I want my game to work on Linux also (and any other system that supports OpenGL for that matter, as Java was intended).
I guess it’s possible to put all OpenGL binaries for every system on Earth in a RAR archive, and then include it with my game distribution. However this requires the user to find the correct binaries and place them in the same directory as the jar file. And what if the binaries get old or does not exist?
I have played a few Jogl games from my browser, using Java Web Start (jnlp file). I realized that these games do not require any DLL files to be placed outside of the jar file, and when I downloaded and inspected the jar file the DLL files was not inside it. This is also true for the official Jogl demos at: https://jogl-demos.dev.java.net/
Why can these Java Applications run Jogl??
I want to distribute my game as a single jar file too, I don’t want to have to bundle the neccessary binaries for Jogl.
What’s the secret?