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

java.lang NoClassDef Found Error

Glenn Johnson

Joined: Sep 24, 2003
Posts: 2
Hi gang just joined the javaranch. I have read all the posted docs (and many others). I have set paths etc. uninstalled jdk, reinstalled jdk and still I get the error 'NoClassDef Found Error' when I try to compile...why? I am about ready to give up and All I want to do is program at home (it works at college)whats wrong with my computer?
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
please post the stacktrace of your ClassNotFoundException cause there is
also the information which class can't be found. did you add all required
jar's to your java and javac call ? (via -cp .... )
Is it a web application within a container or a desktop application ?
[ September 24, 2003: Message edited by: Oliver Refle ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
In the absence of specific information about your problem, I refer you to the Sun Java Tutorial - Getting Started. Try what you finf there and let us know exactly what goes wrong. You'll get help for sure...

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Carol Murphy
village idiot

Joined: Mar 15, 2001
Posts: 1202
Obviously your computer is severely damaged. You should send it to me and I will take it off your hands.
Seriously though, if you are getting this message, your class files are not where they can be located. Double check the placement of your class files. Perhaps they aren't where you think they are!
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
We can help you better if you are more specific. What is your path? What is your classpath? Where is your java.exe file? Where is your MyClass.class file? Do you really get the error when you compile (using javac or when you try to run the program (using java MyClass)?
[ September 24, 2003: Message edited by: Marilyn de Queiroz ]

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Jared Knowlton

Joined: Sep 20, 2003
Posts: 17
I had the same problem and it was answered for me by some kind folks in another forum.
Basically make sure when you run the file that you type the java file with the first letter in Caps.
For example:
java Mortgage
If you type java mortgage you'll get the error you are getting.
But of course you need to have your path and classpath set correctly as the others have said.
I agree. Here's the link:
subject: java.lang NoClassDef Found Error
It's not a secret anymore!