Troubleshooting |
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 calledCount.class
. If you try to interprete the file rather than the class, the interpreter displays this error message:The argument to the Java interpreter is the name of the class that you want to use, not the filename.Can't find class Count.classThe main() Method is Not Defined
The Java interpreter requires that the class you execute with it have a method namedmain()
, because the interpreter must have somewhere to begin execution of your Java application. The main() Method discusses themain()
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 messagewhere classname is the name of the class that you tried to run.In class classname: void main(String argv[]) is not definedSee Also
The Java Development Environment
Interpreter Man Page
Troubleshooting |