Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure, Leiningen, and CLASSPATH on Windows

What is the correct way to install Leiningen on Windows? I grabbed the script and did the self install. Tried to run lein new tutorial and got this error:

Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundExcep tion: Could not locate leiningen/core__init.class or leiningen/core.clj on class path: at clojure.lang.Util.runtimeException(Util.java:165) at clojure.lang.Compiler.eval(Compiler.java:6476) at clojure.lang.Compiler.eval(Compiler.java:6431) at clojure.core$eval.invoke(core.clj:2795) at clojure.main$eval_opt.invoke(main.clj:296) at clojure.main$initialize.invoke(main.clj:315) at clojure.main$script_opt.invoke(main.clj:339) at clojure.main$main.doInvoke(main.clj:426) at clojure.lang.RestFn.invoke(RestFn.java:482) at clojure.lang.Var.invoke(Var.java:417) at clojure.lang.AFn.applyToHelper(AFn.java:178) at clojure.lang.Var.applyTo(Var.java:518) at clojure.main.main(main.java:37) Caused by: java.io.FileNotFoundException: Could not locate leiningen/core_init. class or leiningen/core.clj on classpath: at clojure.lang.RT.load(RT.java:430) at clojure.lang.RT.load(RT.java:398) at clojure.core$load$fn_4610.invoke(core.clj:5386) at clojure.core$load.doInvoke(core.clj:5385) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5200) at clojure.core$load_lib.doInvoke(core.clj:5237) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:602) at clojure.core$load_libs.doInvoke(core.clj:5271) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:604) at clojure.core$use.doInvoke(core.clj:5363) at clojure.lang.RestFn.invoke(RestFn.java:408) at user$eval1.invoke(NO_SOURCE_FILE:1) at clojure.lang.Compiler.eval(Compiler.java:6465) ... 11 more

After getting this I added this to my class path: C:\Users\Owner.lein\self-installs\leiningen-2.0.0-SNAPSHOT-standalone.jar Ran again and got same error. What am I missing?

UPDATE Went with 1.6.2 version based off suggestion from @mtyaka

Now I get this error:

Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodErr or: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V at clojure.lang.Util.runtimeException(Util.java:165) at clojure.lang.Compiler.eval(Compiler.java:6476) at clojure.lang.Compiler.eval(Compiler.java:6431) at clojure.core$eval.invoke(core.clj:2795) at clojure.main$eval_opt.invoke(main.clj:296) at clojure.main$initialize.invoke(main.clj:315) at clojure.main$script_opt.invoke(main.clj:339) at clojure.main$main.doInvoke(main.clj:426) at clojure.lang.RestFn.invoke(RestFn.java:482) at clojure.lang.Var.invoke(Var.java:417) at clojure.lang.AFn.applyToHelper(AFn.java:178) at clojure.lang.Var.applyTo(Var.java:518) at clojure.main.main(main.java:37) Caused by: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(IL clojure/lang/Keyword;)V at leiningen.util.paths$native_arch_path.(paths.clj:32) at leiningen.util.paths_init.load(Unknown Source) at leiningen.util.paths_init.(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at clojure.lang.RT.loadClassForName(RT.java:2030) at clojure.lang.RT.load(RT.java:417) at clojure.lang.RT.load(RT.java:398) at clojure.core$load$fn__4610.invoke(core.clj:5386) at clojure.core$load.doInvoke(core.clj:5385) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5200) at clojure.core$load_lib.doInvoke(core.clj:5237) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:602) at clojure.core$load_libs.doInvoke(core.clj:5271) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:602) at clojure.core$require.doInvoke(core.clj:5352) at clojure.lang.RestFn.invoke(RestFn.java:408) at leiningen.core$loading_4414_auto_.invoke(core.clj:1) at leiningen.core_init.load(Unknown Source) at leiningen.core_init.(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at clojure.lang.RT.loadClassForName(RT.java:2030) at clojure.lang.RT.load(RT.java:417) at clojure.lang.RT.load(RT.java:398) at clojure.core$load$fn_4610.invoke(core.clj:5386) at clojure.core$load.doInvoke(core.clj:5385) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5200) at clojure.core$load_lib.doInvoke(core.clj:5237) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:602) at clojure.core$load_libs.doInvoke(core.clj:5271) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:604) at clojure.core$use.doInvoke(core.clj:5363) at clojure.lang.RestFn.invoke(RestFn.java:408) at user$eval1.invoke(NO_SOURCE_FILE:1) at clojure.lang.Compiler.eval(Compiler.java:6465) ... 11 more

like image 787
BuddyJoe Avatar asked Jan 14 '12 16:01

BuddyJoe


2 Answers

It looks like you are trying to install leiningen 2 which is currently in the middle of development and is not really ready yet. I wouldn't be surprised if self-install doesn't work at the moment, especially on Windows.

Please try the stable version of lein.bat (currently 1.6.2).

like image 64
mtyaka Avatar answered Nov 10 '22 04:11

mtyaka


I just wanted to draw attention to the solution, since right now it is found in the comments to the first answer. If you are getting the xception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodErr... you need to delete the clojure jar file from your classpath.

I was using Leiningen 1.6.2 and clojure-1.3.0, as was brun, so can't say for sure if other versions have the same problem.

like image 23
Rick Hall Avatar answered Nov 10 '22 04:11

Rick Hall