The java Interpreter

java, the Java interpreter, is used to run Java applications from the command line. It takes as an argument the name of a class file to run, as in the following example:

java BidMonitor

Although Java class files end with the .class extension, this extension is not specified when using the interpreter.

The class loaded by the Java interpreter must contain a main() method that takes the following form:

public static void main(String[] arguments) { 
    // Method here
}

Some simple Java programs might use only one class—the one containing the main() method. In other cases, the interpreter automatically loads any other classes that are needed.

The Java interpreter runs bytecode—the compiled instructions that are executed by a Java ...

Get Sams Teach Yourself Java 2 in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.