Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang NoClassDef Found Error

 
Glenn Johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Carol Murphy
village idiot
Bartender
Posts: 1202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 MyClass.java) or when you try to run the program (using java MyClass)?
[ September 24, 2003: Message edited by: Marilyn de Queiroz ]
 
Jared Knowlton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
javac Mortgage.java
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic