Hello Guest

Unable to locate library liblwjgl.so in intellij IDEA

  • 2 Replies
  • 100 Views
Unable to locate library liblwjgl.so in intellij IDEA
« on: January 03, 2020, 07:41:16 »
I'm getting the following error. When starting a project in Intellij IDEA.

Code: [Select]
[LWJGL] Failed to load a library. Possible solutions:
a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
Stopping due to fatal error!
Successfully Wrote Crash Report!
java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.so
at org.lwjgl/org.lwjgl.system.Library.loadSystem(Library.java:162)
at org.lwjgl/org.lwjgl.system.Library.loadSystem(Library.java:62)
at org.lwjgl/org.lwjgl.system.Library.<clinit>(Library.java:50)
at org.lwjgl.glfw/org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:674)

I have tried following https://www.youtube.com/watch?v=ZR9hNrnT2QE and https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install under the "IntelliJ IDEA" subheader. Neither have worked and have given me that error message. I have also tried putting "-Dorg.lwjgl.util.DebugLoader=true" in the program arguments. But it seems to not give me any extra information. In eclipse I would fix this issue by adding the *natives*.jar files into the classpath section. But I don't think I am able to do that in intellij.

Also as expected both of the following lines return null.

Code: [Select]
System.out.println(Library.class.getResource("lwjgl.dll"));
System.out.println(Library.class.getClassLoader().getResource("lwjgl.dll"));

What can I do to fix this?

*

Offline KaiHH

  • ****
  • 227
Re: Unable to locate library liblwjgl.so in intellij IDEA
« Reply #1 on: January 03, 2020, 12:34:15 »
-Dorg.lwjgl.util.DebugLoader=true is not meant to be used as a program argument to be received by your own program in the String[] args array of the main method.
Instead, it is meant (like all "-D" arguments) as a JVM argument. So, in IntelliJ IDEA you do not set this in the "Program Arguments:" edit field, but in the "VM options:" field.

Re: Unable to locate library liblwjgl.so in intellij IDEA
« Reply #2 on: January 03, 2020, 21:27:14 »
I tried putting it in the program arguments. It still doesn't appear to be working for some reason.

However Configuration.DEBUG.set(true); does work:

This stuff appears at the top now:
Code: [Select]
[LWJGL] Version: 3.2.3 build 13
[LWJGL] OS: Linux v5.3.0-24-generic
[LWJGL] JRE: 13 amd64
[LWJGL] JVM: OpenJDK 64-Bit Server VM v13+33-Ubuntu-1 by Private Build
[LWJGL] Loading JNI library: lwjgl
[LWJGL] Module: org.lwjgl
[LWJGL] linux/x64/org/lwjgl/liblwjgl.so not found in java.library.path=/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
[LWJGL] liblwjgl.so not found in java.library.path