Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

New To Java, Error After Compiling  RSS feed

 
Miguel Munoz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone so im new to Java (and programing)

I'm trying to follow step by step tutorials so far its going well except now that i am getting this error:

Exception in thread "main" java.lang.NoSuchMethodError: main


Here is the original source code


I can 􏰯􏰊􏰛􏰗􏰎􏰋􏰆􏰯􏰊􏰛􏰗􏰎􏰋􏰆compile no problem and get "Party.class" but when i try to run I get the error

Exception in thread "main" java.lang.NoSuchMethodError: main


Any idea on what i am doing wrong
 
Carey Brown
Bartender
Posts: 2996
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use "java SomeClassName", the JVM looks of a method defined as
public static void main( String[] args )
That is the only starting point allowed.
In your case you might define it as
 
Campbell Ritchie
Marshal
Posts: 55741
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Is that the Party class from Head First Java? It says at the bottom of page 3 that it is not “real code” but shows java Party on the screen on the right of the page. That confuses lots of people.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!