由于storm的普及,clojure重新回到了我的技术中,现在在ubuntu 15.04上安装clojure 1.7最新环境。
下载并解压
wget http://repo1.maven.org/maven2/org/clojure/clojure/1.7.0/clojure-1.7.0.zip
unzip clojure-1.7.0.zip
进入目录后,用下面的命令进入clojure repl, 做一个简单的加法
clojure-1.7.0$ java -cp clojure-1.7.0.jar clojure.main
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Clojure 1.7.0
user=> (+ 1 2)
3
速度好快,没有 1.4版本的几十秒等待了。看来改进了不少。
下面是安装leiningen工具,方便创建工程
cd /usr/bin/ & wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein .
chmod +x lein
之后在非root帐号下运行lein下载,注意,需要proxy,因为amazon网站已经被屏蔽了。
程序下载完成后,基本开发环境安装完毕。
$ lein repl
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Retrieving org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.pom from central
Retrieving org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar from central
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
nREPL server started on port 39535 on host 127.0.0.1 - nrepl://127.0.0.1:39535
REPL-y 0.3.7, nREPL 0.2.10
Clojure 1.7.0
OpenJDK 64-Bit Server VM 1.7.0_79-b14
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (+ 1 2 3 4)
10
user=> exit
Bye for now!
Ubuntu下Eclipse开发Clojure:http://www.linuxdiyf.com/linux/2556.html
Ubuntu下安装JDK7(附Clojure下载):http://www.linuxdiyf.com/linux/1909.html