Create your first Java program:
1. Type (or copy) the following program on Notepad.
public class HelloPrinter { public static void main(String[] args) { System.out.println("Hello, World!"); } }
2. Save the file as
HelloPrinter.java
in the hello folder of your USB flash drive.
File name must be same as the class name that
includes main method and
the extension of file must be java.
3. Click Start / Programs / Accessories / Command Prompt as below
The DOS command
line is shown.
4. Change the drive to E by typing E:
5. Change folder to hello by typing cd hello
6. Compile your program by typing javac HelloPrinter.java
7. The HelloPrinter.class will be created. Then, run your program by typing java HelloPrinter
8. The words of "Hello World!" will be displayed.