0

Possible Duplicate:
Causes of 'java.lang.NoSuchMethodError: main Exception in thread “main”'

I am having a problem,when I type the following code in eclipse I the error "Exception in thread "main" java.lang.NoSuchMethodError: main"

public class Hello {

    public void main() {

System.out.println("Hello world!");
    }

}

This is the first time I am using eclipse and I wanted to see what it is like. I am using ubuntu 12.04 with java-6-openjdk-i386

Community
  • 1
  • 1
user1659754
  • 53
  • 2
  • 4

1 Answers1

1

You need to use:

public static void main(String[] args) {
    System.out.println("Hello world!"); 
}

Or equivalently:

public static void main(String... args) {
    System.out.println("Hello world!"); 
}
aroth
  • 51,522
  • 20
  • 132
  • 168