Good day everyone,
I have a small project which uses jni and till now I had the dynamic library in an fixed folder for testing.
Now I am trying to bundle it within the jar and because I am using Lwjgl anyway for convenience I wanted to use the loading facilities from org.lwjgl.system.Library
.
This does not work for me I received an java.lang.UnsatisfiedLinkError: test.Test.add(II)I
Exception.
Lwjgl3 provides the following log for a lib not packed (And a similar for one with a packed lib):
[LWJGL] Version: 3.1.6 build 14
[LWJGL] OS: Windows 10 v10.0
[LWJGL] JRE: 10.0.1 amd64
[LWJGL] JVM: Java HotSpot(TM) 64-Bit Server VM v10.0.1+10 by "Oracle Corporation"
[LWJGL] Loading library (system): lwjgl
[LWJGL] Found at: C:\Users\CJG\AppData\Local\Temp\lwjglCJG\3.1.6-build-14\lwjgl.dll
[LWJGL] Loaded from org.lwjgl.librarypath: C:\Users\CJG\AppData\Local\Temp\lwjglCJG\3.1.6-build-14\lwjgl.dll
[LWJGL] Loading library: C:\Users\CJG\eclipse-workspace\test\build\lib\main\release\test.dll
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Success
When I use System#load
or System#loadLibrary
(Even when using an absolute path to the file lwjgl3 extracted) everything works as expected.
When I use System#load
after calling Library#loadNative
the Exception stays the same.
Do I have some misconception about Library
? Anyway, thanks to everyone who can help me (or can not help me but took the time to consider if he possibly could )
Have a nice weekend
-ClaasJG