Set up La Clojure with LWJGL

After setting up La Clojure / IntelliJ, I also tried setting up LWJGL.

After downloading / unpacking LWJGL, I added lwjgl.jar and lwjgl_util.jar to the libraries in the section "file → project structure".

Then I switched to the / repl console and tried to import the classes needed to implement the main example specified on the lwjgl homepage. However, I was only partially successful; here are my results:

user=> (import org.lwjgl.LWJGLException) org.lwjgl.LWJGLException user=> (import org.lwjgl.opengl.Display) UnsatisfiedLinkError no lwjgl in java.library.path java.lang.ClassLoader.loadLibrary (ClassLoader.java:1860) 

Why can I import 'org.lwjgl.LWJGLException' but not 'org.lwjgl.opengl.Display'? Or may I have misinterpreted REPL output?

+4
source share
1 answer

LWJGL is a bit more complicated than other (pure Java) libraries, as it also has some native code dependencies for OpenGL. You need to enable these dependencies, or part of Java LWJGL will not work.

Possible options:

  • Explicitly tell Java to load your own library with something like "-Djava.library.path = .. \ libs \ win32" as a java option on the command line. Perhaps you can also configure IntelliJ for this. See http://lwjgl.org/installation.php .
  • Use something like Maven or Leiningen to handle dependencies for you. LWJGL is located on Maven Central , so it's pretty easy to pull in. Ultimately, you'll probably want to find out, as it will save you a lot of time with more complex builds.
  • Use a library that already binds all the dependencies for you. Penumbra may be a good choice.
+4
source

Source: https://habr.com/ru/post/1399678/


All Articles