Why do I get a NoClassDefFoundError when trying to run my application?

You haven't shown how you ran the code. My guess is that you ran.

You haven't shown how you ran the code. My guess is that you ran: java class which tries to run a class called class. The class is just named so you need: java If you haven't set a CLASSPATH environment variable, that should be fine.

Otherwise, either set it to a path including . Or specify it on the command line: java -cp . This is assuming you compiled the code first, using a command like this: javac java.

Thanks man! How stupid of me lol... I did it a million times, but for some reason, this time I forgot that I should omit the . Class – Agadoo Aug 15 '11 at 19:17 You should accept @Jon Skeet answer so – Snicolas Aug 15 '11 at 19:45.

You have the environment variable CLASSPATH set, but it doesn't include a ". " (dot) to represent the current directory (as the default does. ) Run like this: java -cp .

That's "java space dash cp space dot space Once you get past " World", you'll find that setting the class path becomes necessary all the time -- whether by hand like this (rarely, in the real world) or in a startup script, build tool, or IDE. Use of the CLASSPATH environment variable is a bad practice leftover from Java's early days. Often you'll find that it's Apple's QuickTime installer that is setting it to something.

You should never use or rely on this variable.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions