On this page
Compile "Hello, World!"
-
Compile Use the javac command to compile the Java file into bytecode:
javac HelloWorld.java
This produces a HelloWorld.class file, which contains platform-independent bytecode.
-
Run Execute the program using the java command:
java HelloWorld
The JVM loads the .class file, translates it to machine code, and runs the program.