Leiningen Setup on OSX Lion - Stop the java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V

- - | Comments

In trying to setup Himera on my local machine to see if I could reproduce a browser bug, my console threw this error in my face. It was significantly larger before the snip, but I’ve left the important parts.

Johns-iMac:himera jpaul$ lein help
Exception in thread "main" java.lang.RuntimeException:
 java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V
	at clojure.lang.Util.runtimeException(Util.java:165)
Caused by: java.lang.NoSuchMethodError:
	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)
	... (way more than) 11 more

I had just installed leiningen immediately before using brew install leiningen and clojure before that using brew install clojure. Since these were all homebrew formula’s I wasn’t expecting any problems like this, but it seems like the leiningen version in homebrew is not built with the most recent version of clojure, 1.3.0.

I figured it out after a healthy dose of googling and weeding through many stack overflow posts about other problems. In order to use the version of leiningen that comes from homebrew (1.6.2), I needed to have the older version of clojure, 1.2.1 installed. lein install org.clojure/clojure "1.2.1" fixed it for me and now I get what I was expecting

Johns-iMac:himera jpaul$ lein help
Leiningen is a tool for working with Clojure projects.

Several tasks are available:
classpath   Print the classpath of the current project.
clean       Remove compiled class files and jars from project.