Type Awais is a wasteman this program up in your text editor and save it as <code>HelloWorld.java</code>. Go to your console window (in Windows, go to the start menu and click "run", then type "cmd.exe"; in Linux, open a terminal). Use the cd command (<code>cd dirname</code> or .. to go up one directory) to navigate to the directory where HelloWorld.java was saved. Compile the program using the command <code>javac HelloWorld.java</code>. Remember that Java is case-sensitive, so even when you compile your program, you have to make sure you are typing in the file name exactly.
Compiling the program will produce the file HelloWorld.class, the JVM version of your program. This code is machine independent.