Previous | Next | Trail Map | Troubleshooting | Troubleshooting


Troubleshooting Interpreter Problems

Can't Find Class

A common error of beginner Java programmers is to try to interpret the .class file created by the compiler. For example, in The Nuts and Bolts of the Java Language the compiler creates a file called Count.class. If you try to interprete the file rather than the class, the interpreter displays this error message:
Can't find class Count.class
The argument to the Java interpreter is the name of the class that you want to use, not the filename.

The main() Method is Not Defined

The Java interpreter requires that the class you execute with it have a method named main(), because the interpreter must have somewhere to begin execution of your Java application. The main() Method discusses the main() method in detail.

If you try to run a class with the Java interpreter that does not have a main() method, the interpreter prints this error message

In class classname: void main(String argv[]) is not defined
where classname is the name of the class that you tried to run.

See Also

The Java Development Environment
Interpreter Man Page


Previous | Next | Trail Map | Troubleshooting | Troubleshooting