Compiling and Executing Java Programs
To compile the code in a file containing the class X:
Name the file X.java
Execute the command
javac X.java
or alternatively, execute the command
javac *.java
to compile all the .java files in the directory.
The compilation produces a file of byte code named X.class
To execute the compiled code
Execute the command
java X [any command line parameters]