File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Clojure and the fly likes java.lang.NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Clojure
Bookmark "java.lang.NoClassDefFoundError " Watch "java.lang.NoClassDefFoundError " New topic


Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136


I did CounterClockWise setup with Eclipse Indigo (OS: Windows 7) and wrote the first Clojure program. It ran nicely.

But today when I opened my Clojure project and tried to run the same program I am getting this exception.
This must be something silly but being new to Clojure I don't know how to fix it.

java.lang.NoClassDefFoundError: clojure/main
Caused by: java.lang.ClassNotFoundException: clojure.main
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
Exception in thread "main"

Thanks and Regards,
Sean Corfield
Ranch Hand

Joined: Feb 09, 2011
Posts: 283

Check the project Build Path (right-click on the project name in the navigator and go Build Path > Configure Build Path... if that's present or Properties, then Java Build Path, otherwise). Sounds like the Clojure JAR is missing.
Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136

Thanks Sean, that resolved my issue. I am slowly getting the hang of it.
I found the reason which caused this issue.
I accidentally installed Maven in this Clojure project (I don't know about Maven).
And that did remove all the required jar files from build path.
Let me figure out how does pom.xml works.

I agree. Here's the link:
subject: java.lang.NoClassDefFoundError
jQuery in Action, 3rd edition