本文共 1512 字,大约阅读时间需要 5 分钟。
安装JDK
尝试使用homebew来安装clojure SDK
brew install clojure
luogw@luogw-MacBook-Pro notes$ brew install clojureUpdating Homebrew...==> Auto-updated Homebrew!Updated 1 tap (homebrew/core).==> Updated Formulaedocfx==> Downloading https://download.clojure.org/install/clojure-tools-1.9.0.381.tar.gzcurl: (35) Server aborted the SSL handshakeError: Failed to download resource "clojure"Download failed: https://download.clojure.org/install/clojure-tools-1.9.0.381.tar.gz
网络有问题,安装失败,那就下载源码并编译吧
如下是网官的指引git clone https://github.com/clojure/clojure.gitcd clojure./antsetup.sh# 编译clojure SDKant local
clone源码后,执行antsetup.sh遇到如下问题(代码cloen的目录在/Users/luogw/dev_tool/clojure)
luogw@luogw-MacBook-Pro clojure$ ./antsetup.sh./antsetup.sh: line 3: mvn: command not foundcat: maven-classpath: No such file or directorycat: maven-classpath: No such file or directoryWrote maven-classpath.properties for standalone ant use
出错提示没有安装mvn
安装mvn还有ant(注:后面编译clojure时需要ant的!)brew install maven brew install ant
编译成功后,目录下有clojure.jar
在.bash_profile里添加如下配置# for clojurealias start_clojure='java -jar /Users/luogw/dev_tool/clojure/clojure.jar'
进入clojure 的REPL交互模式(运行前面添加的start_clojure命令 ),直接写clojure脚本
luogw@luogw-MacBook-Pro temp$ source ~/.bash_profileluogw@luogw-MacBook-Pro temp$ start_clojureClojure 1.10.0-master-SNAPSHOTuser=> println "hello, clojure"#object[clojure.core$println 0x2ef14fe "clojure.core$println@2ef14fe"]"hello, clojure"user=>
TODO
转载地址:http://xxmbi.baihongyu.com/