Using lwjgl in Leiningen/Clojure

前端 未结 4 1434
独厮守ぢ
独厮守ぢ 2021-01-02 10:00

Solution

(1) (println (. System getProperty \"java.library.path\"))

This gives me a list of places java looks for native extensions.

4条回答
  •  天命终不由人
    2021-01-02 10:42

    Ran into this today, solved it a bit differently by adding the native directory to :jvm-opts in project.clj:

    (defproject projectname "0.0.1-SNAPSHOT"
      :description "my project"
      :jvm-opts ["-Djava.library.path=native/linux"]
      :dependencies [[org.clojure/clojure "1.4.0"]])
    

    I copied the jar files from the latest lwjgl release into lib and copied the native directory into the project root. Seems to work so far:

    user=> (import org.lwjgl.opengl.Display)
    org.lwjgl.opengl.Display
    

    But I am only just getting started. Anyway, hope this helps someone else :)

提交回复
热议问题