• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

New To Java, Error After Compiling

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 9562
79
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 76444
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic