java.lang.NoSuchMethodError:clojure.lang.KeywordLookupSite运行Leiningen时 [英] java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite when running Leiningen
问题描述
我刚刚下载Leiningen,但我不能管理运行它。在下载其自己的Jar存档后,脚本失败并显示java错误。通过运行 bash -x lein
我可以看到它挂在这一行:
I have just downloaded Leiningen but I cannot manage to run it. After downloading its own Jar archive, the script fails with a java error. By running bash -x lein
I can see that it hangs at this line:
+ exec java -Xbootclasspath/a:/home/andrea/.m2/repository/org/clojure/clojure/1.2.1/clojure-1.2.1.jar -client -Dleiningen.original.pwd=/home/andrea/bin -cp /home/andrea/.clojure/clojure.jar:::::test/:src/:resources/:/home/andrea/.lein/self-installs/leiningen-1.6.2-standalone.jar clojure.main -e '(use '\''leiningen.core)(-main)' /dev/null
b $ b
它产生:
Which produces:
Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
有趣的是,失败的不是Java调用,但是代码片段'(使用'\''leiningen.core)( - main)'
。运行那行没有它激发事实上工作clojure REPL。 leiningen-1.6.2-standalone.jar似乎在正确的路径。有任何想法吗?我是Java和Clojure的新手...
Interestingly, what fails is not the Java call, but the snippet '(use '\''leiningen.core)(-main)'
. Running that line without it fires in fact a working clojure REPL. The leiningen-1.6.2-standalone.jar seem to be in the right path. Any ideas? I am new to both Java and Clojure...
推荐答案
根据参考文献[1],你需要添加Clojure home到类路径。
According the the reference [1], you need to add Clojure home to the classpath.
echo "export CLOJURE_HOME=$HOME/Opt/clojure
export CLASSPATH=$CLASSPATH:$CLOJURE_HOME" >> $HOME/.profile
这篇关于java.lang.NoSuchMethodError:clojure.lang.KeywordLookupSite运行Leiningen时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!