Java Zealot wrote:
I know this error is shown if main is not in the class definition but I do have main in the class. My program is very simple one
Angus Comber wrote:It should be:
public static void main(String[] s)
and not:
public static void main(String s[])
Nimi Verma wrote:Hi everyone,
I have installed java jdk on my pc. Till yesterday it was running fine but today it is giving a strange problem. Actually the problem is when I'm typing javac command in command prompt (win xp) it shows no error and when I run my program with java command it says Exception in thread "main" java.lang.NoClassDefinitionFoundError: Hello
I know this error is shown if main is not in the class definition but I do have main in the class. My program is very simple one
The strange thing about the problem is when I'm changing main to something like mainn it doesn't show any error even then, but if I put a semi-colon (;) after public static void main(String s[]) like this public static void main(String s[]); it shows error. What I think is somehow main is not getting compiled with javac command. Or could it be problem of installation. But till yesterday it was running fine. I have jdk 1.4 installed on my pc. So please tell me about the problem and thanks a lot.
Well, after much fuss the problem has got solved but I have permanently set the class path in Environment Variables as .;
But if tomorrow I want to run servlets I'll have to set classpath for that also. So at that time will I remove this classpath or many classpaths can be set simultaneously?
Don't get me started about those stupid light bulbs. |