• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 10705
86
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • 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: 79177
377
  • 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.
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic