Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception in thread main error

 
vinodh kumar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic