java.lang.NoSuchMethodError

Hello friends,

sometimes java can be a real headache! From yesterday, everytime I tried to run a java program...it gives an error message -

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

-

the peculiar thing is the program compiled correctly without any error. But when I tried to run it, it stopped giving the error message. I tried every possible way...setting the PATH & CLASSPATH, uninstalling & then reinstalling java sdk..but all in without any result!

One mote thing I did watch, the programs that fromJApplet class are bound to this error message. Like the following -

////////////////////////////////////////////////////////////////////////////

import java.awt.Graphics;

import javax.swing.*;

public class MyClass extends JApplet {

//code here

public void init() {

//code here

}

public void paint(Graphics g) {

//code here

}

}

//////////////////////////////////////////////////////////////////

-Please can you help? Thanks in advance!!

[1105 byte] By [dev_coola] at [2007-10-2 7:12:37]
# 1

Java applets (and JApplets) are run using an html file, or the appletviewer program; Java applications are run using the java (or javaw) command from the commandline.

You tried to run a JApplet with the java command, not valid. Create an html file - here's information: http://java.sun.com/docs/books/tutorial/getStarted/applet/running.html

(Hint: Sun's Java Tutorial has answers to most of your questions)

ChuckBinga at 2007-7-16 20:46:16 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
Please do not post in multiple forums, you caused wasted duplication of replies.
ChuckBinga at 2007-7-16 20:46:16 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3
Thanks Chuck,I followed your path & my code works fine now. And I'm really sorry for the multiple post...actually I was just worried & wanted to have the solution as early as possible...sorry again!
dev_coola at 2007-7-16 20:46:16 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...