how to add lwjgl to classpath outside of IDE

Started by vavris, November 07, 2020, 23:34:59

Previous topic - Next topic

vavris

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:
java -jar myJar.jar
it throws the following error:
[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?