解决方案
(1) (println (. System getProperty "java.library.path"))
这会给我一个列表,其中包含java寻找本机扩展的位置。
然后,我把lwjgl本机扩展放到那里。
对我无效的东西(可能是因为我使用不正确)
(*) setting :native-path
(*) setting :native-dependencies
问题
我的设备:
(lein deps; echo "====="; cat project.clj; echo "====="; cat src/main.clj; echo "====="; lein repl) &> log
"日志"的内容
Copying 10 files to /Volumes/ramdisk/fail/lib
=====
(defproject
mincase "0.0.1"
:dependencies [[org.clojure/clojure "1.4.0"]
[org.lwjgl.lwjgl/lwjgl "2.8.2"] ]
:repositories {"local" "/Users/x/z/maven_repo"}
:jvm-opts ["-Xms4g" "-Xmx4g"]
:repl-init main
)
=====
(ns main
(:import org.lwjgl.opengl.Display))
=====
REPL started; server listening on localhost port 31235
UnsatisfiedLinkError no lwjgl in java.library.path java.lang.ClassLoader.loadLibrary (ClassLoader.java:1860)
clojure.core=>
注意--我已经执行了"lein deps",所以lwjgl库已经被拉入maven。我不理解的是:
(*) how do I get access to lwjgl from Clojure?
(*) more importantly, how do I debug which step this whole thing has gone wrong at?
$ find lib
lib
lib/clojure-1.4.0.jar
lib/jinput-2.0.5.jar
lib/jinput-platform-2.0.5-natives-linux.jar
lib/jinput-platform-2.0.5-natives-osx.jar
lib/jinput-platform-2.0.5-natives-windows.jar
lib/jutils-1.0.0.jar
lib/lwjgl-2.8.2.jar
lib/lwjgl-platform-2.8.2-natives-linux.jar
lib/lwjgl-platform-2.8.2-natives-osx.jar
lib/lwjgl-platform-2.8.2-natives-windows.jar
看起来lwjgl已经被引入了。
我应该尝试哪些步骤来确定我哪个步骤出错了?
谢谢!