aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » Clojure
Bookmark "java.lang.NoClassDefFoundError " Watch "java.lang.NoClassDefFoundError " New topic
Author

java.lang.NoClassDefFoundError

Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136

Hi,

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 java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Exception in thread "main"




Thanks and Regards,
~Sujoy
Sean Corfield
Ranch Hand

Joined: Feb 09, 2011
Posts: 261
    
    5

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: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError