Every Java program that used to run no longer does. They compile OK, but when I try to run them, I get the following run-time error: "Exception in thread "main" java.lang.NosuchMethodError" - main I can't even run a HelloWorld program. My source and object files are in c:\java My autoexec.bat file looks like this: path=c:\windows;c:\windows\command;c:\jdk1.3.0_02\bin;c:\java;. set classpath.;c:\jdk1.3.0_02\lib\tools.jar;c:\java;. Does anyone have any idea why I'm getting this run-time error all of a sudden on files that used to run OK?
Make sure there is a space between the word classpath and the first dot. Add the bin directory in like we talked about before. Show us how you are invoking the program.
"JavaRanch, where the deer and the Certified play" - David O'Meara
I had the same problem too...I fixed with some help from Cindy ...my problems were: I was copying and pasting the main mehtod...and secondly..I had a bunch of *.java and *.class files in another directory..which I deleted...hope this helps
Originally posted by Gary Farms: My autoexec.bat file looks like this: path=c:\windows;c:\windows\command;c:\jdk1.3.0_02\bin;c:\java;. set classpath.;c:\jdk1.3.0_02\lib\tools.jar;c:\java;.
Gary, the set classpath command should be like this: set classpath=.;c:\jdk1.3.0_02\lib\tools.jar;c:\java; Note: no spaces between "classpath=."