The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Strange Exception

Posted by Michael on November 29, 2000 at 7:23 AM


I encountered the following exception when tried to
run my Java program:

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

This is my class definition:

public class MZMZ
public static void main(String[] args)
System.out.println("Hello Horse");

To prove my class does contain main mehtod, I run
"javap MZMZ", here is the outcome:

Compiled from
public class MZMZ extends java.lang.Object{
public MZMZ();
public static main(String[] );

This is some extra information:
I run this program on Windows NT 4.0 machine on which
I installed JDK1.2. The directory which contains this
MZMZ.class is specified in CLASSPATH too.

java gurus, please enlighten me what happened to
my Java program/JVM? I even plan to reformat my
harddisk and re-install the OS and JDK.



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us