admin@apollo:~/clojure$ clojure
Clojure 1.0.0-
user=> (require 'clojure.contrib.str-utils)
java.io.FileNotFoundException: Could not locate clojure/contrib/str_utils__init.class or clojure/contrib/str_utils.clj on classpath: (NO_SOURCE_FILE:0)
user=>
我在安装 clojure 时做错了什么?为什么 clojure 找不到我的 java 类?我安装了java。
admin@apollo:~/clojure$ sudo apt-get install sun-java6-jre sun-java6-jdk
sudo: unable to resolve host apollo
Reading package lists... Done
Building dependency tree
Reading state information... Done
sun-java6-jre is already the newest version.
sun-java6-jdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
admin@apollo:~/clojure$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
admin@apollo:~/clojure$
请帮忙!谢谢!
最佳答案
学习手动解决这个问题很棒,因为了解类路径可以让世界变得更美好。在实践中,许多 Clojurians 使用 leiningen、maven 或 cake。
我个人建议使用 leiningen :
- wget http://github.com/technomancy/leiningen/raw/stable/bin/lein
- 将其设为可执行文件并将其保存在 ~/bin 或/usr/bin 或其他位置。
- lein new MY-PROJECT-NAME
- 莱因德普斯
- 回答
- 砍掉!
不使用自动化工具的原因有很多,但并不适合所有人。对于设置它所花费的时间,即使是简单的一行,对我来说也是值得的。
关于java - 帮助运行 clojure,可能的类路径问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3729436/