This discussion is archived
1 2 Previous Next 16 Replies Latest reply: Oct 26, 2006 9:56 AM by 807598 RSS

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

807598 Newbie
Currently Being Moderated
I wrote a small java-code.
I can compile it with "javac".
But when I start it with "java", I get the following error:
Exception in thread "main" java.lang.NoSuchMethodError: main

When I start it with "java Haupt.class", there is another error:
Exception in thread "main" java.lang.NoClassDefFoundError: Haupt/class

What could it be?
The Code is like the code from another java-programm, that is OK.

class Haupt
{
  public static void main( String args[] )
  {
    System.out.println( "Hallo Javanesen" );
  }
}
1 2 Previous Next