Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

captainfat
So a little background.
I am trying to create a runtime-image for my java application by using JLink. My project uses jogamp-fat.jar, which is an automatic module. Jlink doesn't allow you to create a runtime-image if you have any automatic modules in your project. I ended up figuring out a way to convert jogamp-fat.jar to no longer be automatic by using jdeps and javac --patch-module.

This did allow me to execute JLink, and my application still ran just fine. However, when I run the .bat file created from JLink, I get "java.lang.UnsatisfiedLinkError: Can't load library: ...\ bin\natives\windows-amd64\\gluegen.dll".
I've been scratching my head for a couple weeks with this and can't figure it out. Any help would be appreciated, even if the answer is Jlink just can't be used with jogamp-fat.

P.S. My java version is 14.0.1 x64
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

gouessej
Administrator
Hello

Disable the automatic native library loading, put the native libraries somewhere and set the library path. The option to disable the automated native library loading is mentioned in the JOGL user's guide as far as I remember.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

captainfat
So I went to the user guide and added -Djogamp.gluegen.UseTempJarCache=false to my VM options within my NetBeans project. This now causes my project to break when I run it in NetBeans (before only the runtime-image created from jlink broke). It is the same can't load library: "...natives\windows-amd64\gluegen_rt.dll error as before. I've also tried setting the java.library.path within the VM options as well as while the program is running with no success...  I am confused as to why when I remove -Djogamp.gluegen.UseTempJarCache=false from my VM options the application will run when executing from NetBeans. Why is it able to find the natives when I run through netbeans, but cant find it when the runtime-image is executed?
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

captainfat
So update... I ended up resolving the can't load native library error. I did not realize that I needed to unzip the contents of the gluegen-rt-natives-windows-amd64.jar and jogl-all-natives-windows-amd64.jar. I thought I could just reference the jars without unzipping.
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

gouessej
Administrator
Please can you elaborate? Your runtime image must contain the necessary native libraries without relying on the mechanism that unzips them.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

sailsman63
I'm not convinced that this has anything to do with jlink. I'm getting the same type of error in a non-imaged environment with several java installations. (openjdk-11, and AdoptOpenJDK 11 & 17)

The error persists through manually specifying java.library.path and disabling jogamp.gluegen.UseTempJarCache.

The property java.library.path is picked up and visible inside the VM, but the library loading insists on searching "working-directory"/natives/gluegen-rt-platform-suffix.
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

gouessej
Administrator
Ok, I'll have to have a look at this mechanism in GlueGen. If you're right, it's definitively not the expected behavior.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

sailsman63
Of note, the same configuration (In fact, the same working directory) functions correctly with OpenJDK-8.
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

sailsman63
And I hate to do this to you, but after several clean and build cycles for unrelated reasons, I can no longer reproduce this issue. (I had been cleaning and building while I was seeing the issue...) I'll keep an eye on the discussion, and update you if I can manage to duplicate again.
Reply | Threaded
Open this post in threaded view
|

Re: Jogamp-fat.jar can't load library: "...natives\windows-amd64\\gluegen_rt.dll"

gouessej
Administrator
Does it have something to do with a change of name to allow the use of static linking? I don't remember the name of the JEP.
Julien Gouesse | Personal blog | Website