What is the name of the Java command-line tool that executes a compiled Java program?

The story behind the answer

The Java command-line tool that executes a compiled Java program is `java`.

Java source code is normally compiled by `javac`, which turns a `.java` file into JVM bytecode stored in a `.class` file. The `java` launcher then starts the Java Virtual Machine, loads the requested class, and invokes its `main` method when the program follows the traditional application model.

The tools in the options have different jobs. `javac` compiles source code, `jar` packages classes and resources into an archive, and `javadoc` generates API documentation from source comments. A common mix-up is calling `java` an interpreter: historically it was described that way, but modern JVMs also use just-in-time compilation to translate frequently executed bytecode into native machine code while the program runs.

The command commonly looks like `java ClassName`; the `.class` suffix is usually omitted. Since Java 11, the launcher can also run a single source file directly, but its classic role remains launching compiled Java applications.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: