Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Getting the error "Exception in thread "main" java.lang.NoSuchMethodError: main" while trying to run

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm new to Java , was trying to run a code given in "Head First Java".

While trying to run the below code I'm getting the error "Exception in thread "main" java.lang.NoSuchMethodError: main".

Below is the code.

 
Ranch Hand
Posts: 375
1
Python Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liju Tom wrote:


This code on it's own will neither run as an Applet, nor as a simple Java class.
This code must be a simple code segment to demonstrate the use of Panel in AWT.

You should go back and see how a simple Applet code is written and run.. (What a class needs to do to become an Applet)
See Defining an Applet Subclass for more details..
 
Liju Tom
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys thanks for the help.
Amazing!! I didn't expect the reply to be this fast
 
I am mighty! And this is a mighty small ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!