一、下載 leiningen 的 jar
從 https://github.com/technomancy/leiningen/downloads 下載 leiningen-2.0.0-preview10-standalone.jar
二、下載windows下啟動lein的指令碼
https://raw.github.com/technomancy/leiningen/preview/bin/lein.bat
三、執行指令碼
在c:\dev-evn目錄下建立一個檔案夾 lein,將jar和bat檔案放入。
進入c:\dev_evn\lein下執行,lein.bat。顯示:
C:\DEV_EVN\lein>lein.batC:\Documents and Settings\david\.lein\self-installs\leiningen-2.0.0-preview10-standalone.jar can not be found.You can try running "lein self-install"or change LEIN_JAR environment variableor edit lein.bat to set appropriate LEIN_JAR path.
四、修改指令碼
修改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:\dev_evn\lein\leiningen-2.0.0-preview10-standalone.jar
執行 lein.bat , 顯示:
Could not find artifact lein-newnew:lein-newnew:pom:0.3.5 in central (http://repo1.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/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.maven.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.maven.org/maven2)Retrieving bultitude/bultitude/0.1.7/bultitude-0.1.7.pom (2k) from https://clojars.org/repo/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://repo1.maven.org/maven2)Could not find artifact scout:scout:jar:0.1.0 in central (http://repo1.maven.org/maven2)Could not find artifact quoin:quoin:jar:0.1.0 in central (http://repo1.maven.org/maven2)Could not find artifact stencil:stencil:jar:0.3.0 in central (http://repo1.maven.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 slingshot:slingshot:jar:0.8.0 in central (http://repo1.maven.org/maven2)Could not find artifact bultitude:bultitude:jar:0.1.7 in central (http://repo1.maven.org/maven2)Retrieving slingshot/slingshot/0.8.0/slingshot-0.8.0.jar (6k) from https://clojars.org/repo/Retrieving quoin/quoin/0.1.0/quoin-0.1.0.jar (3k)from https://clojars.org/repo/Retrieving scout/scout/0.1.0/scout-0.1.0.jar (4k)from https://clojars.org/repo/Retrieving stencil/stencil/0.3.0/stencil-0.3.0.jar (13k) 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/Retrieving bultitude/bultitude/0.1.7/bultitude-0.1.7.jar (4k) 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 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.
五、測試
運行 lein.bat version
Leiningen 2.0.0-preview10 on Java 1.6.0_12 Java HotSpot(TM) Client VM