aspose file tools*
The moose likes Cattle Drive and the fly likes exception in thread main error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "exception in thread main error" Watch "exception in thread main error" New topic
Author

exception in thread main error

vinodh kumar
Greenhorn

Joined: Oct 18, 2005
Posts: 1
my java jdk has some problems.It compiles files correctly and while running it shows as :

D:\Java\programs>javac HelloWorld.java

D:\Java\programs>java HelloWorld
Exception in thread "main" java.lang.NoSuchMethodError: main

I have given the path and classpath correctly but still i face the problem even after new installation of jdk.My present version is older than the previous version.Please reply soon as my works are pending .
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
Originally posted by vinodh kumar:
my java jdk has some problems.It compiles files correctly and while running it shows as :

D:\Java\programs>java HelloWorld
Exception in thread "main" java.lang.NoSuchMethodError: main

I have given the path and classpath correctly.


Does your HelloWorld have a main method that looks like
public static void main( String[] args )
??
[ October 18, 2005: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: exception in thread main error