java Command
The java command runs a Java program from a command prompt. The basic syntax is
java filename [options]
When you run the java command, the JRE is loaded along with the class you specify. Then, the main method of that class is executed.
Here’s an example that runs a program named HelloApp:
C:\java\samples>java HelloApp
The Java runtime command lets you specify options that can influence its behavior.
|
Option |
Description |
|
|
Lists standard options |
|
|
Lists the directories or JAR or Zip archive files used to search for class files |
|
|
Runs the client virtual machine |
|
|
Does the same thing as |
|
|
Sets a system property |
|
|
Disables system assertions |
|
|
Enables assertions for the specified classes or packages |
|
|
Enables the |
|
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access