Hello Guest

how to add lwjgl to classpath outside of IDE

  • 1 Replies
  • 4283 Views
how to add lwjgl to classpath outside of IDE
« on: November 07, 2020, 23:34:59 »
I have been working on a lwjgl project. In my IDE (IntelliJ) it works just fine as it runs it with the classpath argument where it specifies the path to the lwjgl natives, but whenever I run the jar outside of the IDE like this:
Code: [Select]
java -jar myJar.jar it throws the following error:
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.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: lwjgl.dll
        at org.lwjgl.system.Library.loadSystem(Library.java:162)
        at org.lwjgl.system.Library.loadSystem(Library.java:62)
        at org.lwjgl.system.Library.<clinit>(Library.java:50)
        at org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:674)
        at ConsoleWindow.<init>(ConsoleWindow.java:92)
        at Main.main(Main.java:4)
I see the possible solutions but how exactly am I supposed to do it?
« Last Edit: November 07, 2020, 23:53:53 by vavris »

Re: how to add lwjgl to classpath outside of IDE
« Reply #1 on: November 10, 2020, 08:12:29 »
nvm, fixed