Leiningen 安装

Leiningen是一个Clojure项目管理工具。

安装过程如下:

1. 下载lein脚本

https://raw.github.com/technomancy/leiningen/preview/bin/lein

2. 复制到/usr/bin目录下,并允许执行

mv lein /usr/bin/
root@chenshu-yangzhou-home:~/Downloads# chmod +x /usr/bin/lein 

3. 运行lein命令,不要使用root权限
 lein
Downloading Leiningen now...
--2012-12-25 17:20:49--  https://github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview10-standalone.jar
Resolving github.com (github.com)... 207.97.227.239
Connecting to github.com (github.com)|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview10-standalone.jar [following]
--2012-12-25 17:20:50--  http://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview10-standalone.jar
Resolving cloud.github.com (cloud.github.com)... 216.137.55.10, 216.137.55.192, 216.137.55.57, ...
Connecting to cloud.github.com (cloud.github.com)|216.137.55.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11129174 (11M) [application/x-java-archive]
Saving to: `/home/chenshu/.lein/self-installs/leiningen-2.0.0-preview10-standalone.jar.pending'

100%[======================================>] 11,129,174   459K/s   in 23s     

2012-12-25 17:21:14 (470 KB/s) - `/home/chenshu/.lein/self-installs/leiningen-2.0.0-preview10-standalone.jar.pending' saved [11129174/11129174]

Leiningen is a tool for working with Clojure projects.

Several tasks are available:
check               Check syntax and warn on reflection.
classpath           Write the classpath of the current project to output-file.
clean               Remove all files from project's target-path.
compile             Compile Clojure source into .class files.
deploy              Build jar and deploy to remote repository.
deps                Show details about dependencies.
do                  Higher-order task to perform other tasks in succession.
help                Display a list of tasks or help for a given task.
install             Install current project to the local repository.
jar                 Package up all the project's files into a jar file.
javac               Compile Java source files.
new                 Generate project scaffolding based on a template.
plugin              DEPRECATED. Please use the :user profile instead.
pom                 Write a pom.xml file to disk for Maven interoperability.
repl                Start a repl session either with the current project or standalone.
retest              Run only the test namespaces which failed last time around.
run                 Run the project's -main function.
search              Search remote maven repositories for matching jars.
show-profiles       List all available profiles or display one if given an argument.
test                Run the project's tests.
trampoline          Run a task without nesting the project's JVM inside Leiningen's.
uberjar             Package up the project files and all dependencies into a jar file.
upgrade             Upgrade Leiningen to specified version or latest stable.
version             Print version for Leiningen and the current JVM.
with-profile        Apply the given task with the profile(s) specified.

Run lein help $TASK for details.

See also: readme, faq, tutorial, news, sample, profiles,
deploying and copying.

注意国内可能需要使用proxy才能下载,参考我的关于终端如何设置http代理的方式。

http://blog.csdn.net/sheismylife/article/details/8331287

如果因为网络原因安装失败,删除掉~/.lein目录后重新执行lein命令即可。

现在可以启动一个REPL会话,上一片里面用的是java -cp 命令,这里更简单:

$ lein repl
nREPL server started on port 55538
REPL-y 0.1.0-beta10
Clojure 1.4.0
    Exit: Control+D or (exit) or (quit)
Commands: (user/help)
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
          (user/sourcery function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc]
          (user/clojuredocs name-here)
          (user/clojuredocs "ns-here" "name-here")
user=>
输入一个lisp表达式看看:
user=> (+ 1 2)
3
能够运行。注意=>左边的user代表当前的namespace.

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

猜你喜欢

转载自www.cnblogs.com/skiwnywh/p/10321234.html