When following the examples, Java throws an UnsatisfiedLinkError when trying to load libUltralightCore. I'm properly setting the java.library.path to also have the Ultralight bin files. I have no idea why it isn't working and have tried my best to follow it in debug mode. This also occurs on both Linux and Windows and I don't know about macOS
Here's the full expection:
Exception in thread "main" java.lang.RuntimeException: Failed to load ultralight-java-gpu native library.
at com.labymedia.ultralight.gpu.UltralightGPUDriverNativeUtil.load(UltralightGPUDriverNativeUtil.java:141)
at me.toast.engine.ui.UserInterface.<init>(UserInterface.java:62)
at me.toast.engine.Mod.<init>(Mod.java:41)
at test.game.DeathmatchMod.<init>(DeathmatchMod.java:19)
at me.toast.engine.Main.run(Main.java:13)
at me.toast.engine.Main.main(Main.java:42)
Caused by: java.lang.UnsatisfiedLinkError: /home/joshuahiggins/Documents/GitHub/ButterEngine/bin/libultralight-java-gpu.so: libUltralightCore.so: cannot open shared object file: No such file or directory
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2383)
at java.base/java.lang.Runtime.load0(Runtime.java:746)
at java.base/java.lang.System.load(System.java:1857)
at com.labymedia.ultralight.gpu.UltralightGPUDriverNativeUtil.load(UltralightGPUDriverNativeUtil.java:139)
... 5 more
Here's my code for starting Ultralight:
Path nativesDir = Paths.get("bin/");
String libraryPath = System.getProperty("java.library.path");
if (libraryPath != null) {
libraryPath += File.pathSeparator + nativesDir.toAbsolutePath();
} else {
libraryPath = nativesDir.toAbsolutePath().toString();
}
System.setProperty("java.library.path", libraryPath);
try {
UltralightGPUDriverNativeUtil.extractNativeLibrary(nativesDir);
UltralightJava.extractNativeLibrary(nativesDir);
UltralightGPUDriverNativeUtil.load(nativesDir);
UltralightJava.load(nativesDir);
} catch (UltralightLoadException e) {
e.printStackTrace();
}
Here's the tree of my project:
.
├── bin
│ ├── AppCore.dll
│ ├── libAppCore.dylib
│ ├── libAppCore.so
│ ├── libUltralightCore.dylib
│ ├── libUltralightCore.so
│ ├── libUltralight.dylib
│ ├── libultralight-java-gpu.so
│ ├── libultralight-java.so
│ ├── libUltralight.so
│ ├── libWebCore.dylib
│ ├── libWebCore.so
│ ├── resources
│ │ ├── cacert.pem
│ │ └── icudt67l.dat
│ ├── UltralightCore.dll
│ ├── Ultralight.dll
│ └── WebCore.dll
├── libs
│ ├── ...
│ ├── ultralight-java-base-0.4.12.jar
│ ├── ultralight-java-base-0.4.12-javadoc.jar
│ ├── ultralight-java-base-0.4.12-sources.jar
│ ├── ultralight-java-databind-0.4.12.jar
│ ├── ultralight-java-databind-0.4.12-javadoc.jar
│ ├── ultralight-java-databind-0.4.12-sources.jar
│ ├── ultralight-java-gpu-0.4.12.jar
│ ├── ultralight-java-gpu-0.4.12-javadoc.jar
│ ├── ultralight-java-gpu-0.4.12-sources.jar
│ └── ...
├── out
│ └── ...
├── resources
│ ├── assets
│ │ └── ...
│ ├── example.html
│ ├── example.js
│ ├── shader_fill_frag.fs
│ ├── shader_fill_path_frag.fs
│ ├── shader_v2f_c4f_t2f_t2f_d28f.vs
│ ├── shader_v2f_c4f_t2f.vs
│ └── style.css
└── src
└── ...
When following the examples, Java throws an UnsatisfiedLinkError when trying to load libUltralightCore. I'm properly setting the java.library.path to also have the Ultralight bin files. I have no idea why it isn't working and have tried my best to follow it in debug mode. This also occurs on both Linux and Windows and I don't know about macOS
Here's the full expection:
Here's my code for starting Ultralight:
Here's the tree of my project: