When I try running leiningen on my os x lion I get the error below. The install is done as per the instructions on github (README). Can anyone give me a hint on this?
The only possible solution I found via google was to run lein clean
but that fails for me with a similar message.
Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.<init>(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:436)
at clojure.lang.Var.invoke(Var.java:409)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V
at leiningen.util.paths$legacy_native_path.<clinit>(paths.clj:32)
at leiningen.util.paths__init.load(Unknown Source)
at leiningen.util.paths__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
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.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
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
Here is a great way to quickly tell if you have dependencies that use a different version of Clojure:
In all cases, the exception
java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V
means you're trying to run code compiled against clojure 1.2, using clojure 1.3.What's happening here is you have a dev-dependency that's pulling in clojure 1.3 into lib/dev. All of the jars in lib/dev get added to the classpath. Leiningen contains code compiled against clojure 1.2, and you get the exception.
The solution: figure out which dev-dependency is depending on clojure, and exclude it. This will look like
[foo "1.2.0" :exclusions [org.clojure/clojure]]
How do you figure out which dev-dep? Trial and error, or by looking at their project.clj in their source code.
make sure you are running java 1.6+
I have had similar problems when running on systems with outdated java.
I agree with cieplak - I had the same problem just now, lein depends on Clojure 1.2.1 and the default project file it created made my new project depend on Clojure 1.3.0. When I ran 'lein test' to run the tests for the new project Clojure 1.3.0 was downloaded and added to the classpath and then I had the error you state above.
Solution - Delete all the downloaded jars in my new project (in 'libs'), change project.clj to depend on Clojure 1.2.1 to match lein and re-run 'lein test' to download the dependencies. This time, no Clojure version clash and no error :)
Correction - This only works if you do it before each run of 'lein test' :( :(
Update - I have fixed my problem by making sure all the dependencies in my project use the same version of Clojure - 1.2.1. The main dependencies is Midje, so I'm using 1.2.0 of that (which uses 1.2.1 of Clojure) and of course Leiningen itself at version 1.6.2 which uses Clojure 1.2.1 also. Not an ideal situation but at least it works in consecutive runs without having to delete all the dependent libraries!
I have the same problem at the moment. I just installed Incanter using Lein. I fixed it by removing ~/.lein/plugins/incanter-1.3.0-SNAPSHOT.jar.
From what I can tell, the error is caused by a conflict of dependencies on different versions of Clojure. In my case, Incanter depended on Clojure-1.3, while my Lein uses 1.2, and my installed clojure is 1.4.