Clojure学习笔记(2)安装Clojure构建工具 leiningen

1.在C盘下创建一个文件夹,并且命名为home_lein,然后把下载的lein.bat文件和leiningen-2.0.0-preview10-standalone.jar包放到C:\home_lein文件夹下

如下图所示:

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第1张图片

2.修改lein.bat脚本

将lein.bat脚本中的第27行的

if "x%LEIN_JAR%" == "x" set "LEIN_JAR=!LEIN_HOME!\self-installs\leiningen-!LEIN_VERSION!-standalone.jar"

修改为如下:

if "x%LEIN_JAR%" == "x" set "LEIN_JAR=C:\home_lein\leiningen-2.0.0-preview10-standalone.jar"

如下图所示:

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第2张图片

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第3张图片


3.为leiningen设置环境变量

截图

说明

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第4张图片


变量名LEIN_HOME
变量值:C:\home_lein

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第5张图片


变量名:LEIN_JAR
变量值:C:\home_lein\leiningen-2.0.0-preview10-standalone.jar

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第6张图片



Path中添加“;%LEIN_HOME%\;



4.在DOS中输入命令行"lein"以验证leiningen是否已安装成功。

根据运行反馈的信息,leiningen目前还没安装成功。运行结果如下图所示:

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第7张图片

5.通过命令行进入c:\home_lein文件夹下执行命令行"lein.bat"。命令执行结果如下图所示:

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第8张图片


Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>cd c:\home_lein

c:\home_lein>lein.bat
Could not find artifact lein-newnew:lein-newnew:pom:0.3.5 in central (http://rep
o1.maven.org/maven2)
Retrieving lein-newnew/lein-newnew/0.3.5/lein-newnew-0.3.5.pom (3k)
    from https://clojars.org/repo/
Could not find artifact stencil:stencil:pom:0.3.0 in central (http://repo1.maven
.org/maven2)
Retrieving stencil/stencil/0.3.0/stencil-0.3.0.pom (3k)
    from https://clojars.org/repo/
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.pom (5k)
    from http://repo1.maven.org/maven2/
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom (4k)
    from http://repo1.maven.org/maven2/
Could not find artifact scout:scout:pom:0.1.0 in central (http://repo1.maven.org
/maven2)
Retrieving scout/scout/0.1.0/scout-0.1.0.pom (2k)from https://clojars.org/repo/
Could not find artifact quoin:quoin:pom:0.1.0 in central (http://repo1.maven.org
/maven2)
Retrieving quoin/quoin/0.1.0/quoin-0.1.0.pom (2k)from https://clojars.org/repo/
Could not find artifact slingshot:slingshot:pom:0.8.0 in central (http://repo1.m
aven.org/maven2)
Retrieving slingshot/slingshot/0.8.0/slingshot-0.8.0.pom (1k)
    from https://clojars.org/repo/
Retrieving org/clojure/clojure/1.2.1/clojure-1.2.1.pom (1k)
    from http://repo1.maven.org/maven2/
Retrieving org/clojure/core.cache/0.6.1/core.cache-0.6.1.pom (2k)
    from http://repo1.maven.org/maven2/
Retrieving org/clojure/pom.contrib/0.0.26/pom.contrib-0.0.26.pom (5k)
    from http://repo1.maven.org/maven2/
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom (5k)
    from http://repo1.maven.org/maven2/
Could not find artifact bultitude:bultitude:pom:0.1.7 in central (http://repo1.m
aven.org/maven2)
Retrieving bultitude/bultitude/0.1.7/bultitude-0.1.7.pom (2k)
    from https://clojars.org/repo/
Could not find artifact quoin:quoin:jar:0.1.0 in central (http://repo1.maven.org
/maven2)
Could not find artifact scout:scout:jar:0.1.0 in central (http://repo1.maven.org
/maven2)
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.jar (3311k)
    from http://repo1.maven.org/maven2/
Could not find artifact lein-newnew:lein-newnew:jar:0.3.5 in central (http://rep
o1.maven.org/maven2)
Could not find artifact stencil:stencil:jar:0.3.0 in central (http://repo1.maven
.org/maven2)
Could not find artifact slingshot:slingshot:jar:0.8.0 in central (http://repo1.m
aven.org/maven2)
Retrieving org/clojure/core.cache/0.6.1/core.cache-0.6.1.jar (11k)
    from http://repo1.maven.org/maven2/
Could not find artifact bultitude:bultitude:jar:0.1.7 in central (http://repo1.m
aven.org/maven2)
Retrieving slingshot/slingshot/0.8.0/slingshot-0.8.0.jar (6k)
    from https://clojars.org/repo/
Retrieving scout/scout/0.1.0/scout-0.1.0.jar (4k)from https://clojars.org/repo/
Retrieving quoin/quoin/0.1.0/quoin-0.1.0.jar (3k)from https://clojars.org/repo/
Retrieving stencil/stencil/0.3.0/stencil-0.3.0.jar (13k)
    from https://clojars.org/repo/
Retrieving bultitude/bultitude/0.1.7/bultitude-0.1.7.jar (4k)
    from https://clojars.org/repo/
Retrieving lein-newnew/lein-newnew/0.3.5/lein-newnew-0.3.5.jar (15k)
    from https://clojars.org/repo/
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 stan
dalone.
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 argum
ent.
test                Run the project's tests.
trampoline          Run a task without nesting the project's JVM inside Leininge
n'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.
c:\home_lein>


6.根据上图运行反馈的信息,leiningen现在已经安装成功。

现在可以进入到c:\home_lein下通过DOS命令行执行“lein”命令。如下图所示:

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第9张图片

7.现在也可以不用切换到c:\home_lein文件夹,直接就在DOS上通过输入“lein”命令来运行leiningen。如下图所示:

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第10张图片

8.可以通过DOS命令行来检查目前所安装的leiningen的版本。如下图所示:

Clojure学习笔记(2)安装Clojure构建工具 leiningen_第11张图片



leiningen构建工具现在已经安装成功,接下来的学习笔记中将学习采用lein来创建clojure项目。这里要做一个笔记:

因为整个安装过程的截图我保存在word文档中,如果直接复制word文档中的图片黏贴到osc的编辑器中,保存博文之后是无法显示图片的。所以百度了一下怎么把word中的图片还原保存成单个图片,方法如下:

将打开的word文档另存为网页,在word文档的所在位置下会生成一个跟word文档同名的文件夹,里页就有之前保存在word文档中的所有图片。







你可能感兴趣的:(word,clojure,leiningen)