I think I have accidently changed some settings or something, because everything I try to run from a command prompt gives me the error "exception in thread "main": java.lang.NoClassDefFoundError" What could be the cause of this? I've doubled checked my classpath and my path.
You mentioned that you have checked your path. The java interpreter is case sensitive. Make sure you are typing in your class name correctly. That's usually the most likely cause for teh JVM not finding the class file your are specifying. Bosun
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Joined: Dec 07, 2000
sorry, I don't think it's any of those reasons.... When I first started learning java, I had the "Sam's teach yourself java2 in 21 days" and in it there is a series of exercises you can do. I must have done around 30-40 of them, all of which compiled and ran successfully. Now when I go back to them and try and run them, I get that error. The spelling is all right, and I'm not necessarily trying to run servlets. Even a simple hello world application isn't running. Maybe it's because it's friday and I'm tired!!! I'm sure I'm just overlooking something. Thanks for all your help, Annette
Joined: May 05, 2000
are you typing "java Class1.class" . You have to leave off the .class and jus type "java Class1"
i used to get this error and it was my class path...but you checked that..can't help you. ------------------ I wish there was a button on my monitor to turn up the intellegince. Theres a button called 'brightness' but it doesn't work
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
This classpath business on NT is more tricky then on 95/98. It may not suffice to keep it in the autoexec file, some times it is required that you put it in the classpath Environment variable in the Environment properties of System ( from Control Panel). in any case, the actual classpath can be checked by typing echo %classpath% on the console Hope it helps
Hey try adding .; in your classpath as well as the path as that will make it the compiler in the present directory as well. Regrds Shel
Joined: Dec 07, 2000
thanks for all the suggestions! It seems I was able to fix the problem by completely uninstalling the jdk and reinstalling it. Now everywith works fine! That's good for a monday morning! (Now if only the 25cm of snow they are forcasting for tonight will just not come!!!). thanks again! Annette