Java Reference
In-Depth Information
5. Compile your Java source with the SDK compiler (java.exe) in the DOS
command window:
javac HelloWorld.java
6. Your HelloWorld Java program should compile successfully. If it doesn't,
there are three (or more) possible problems:
Cannot find the javac program: Check your PATH environment vari-
able by using the set command in the DOS window. It should contain
the directory where the program javac.exe is (on Windows, normally
C:\Program Files\Java\jdk1.6.0_03\bin).
Cannot find HelloWorld.java: Check the spelling, and make sure you
used the correct case. Are you in the directory where the source file was
saved (C:\java4cobol)?
The compile reported some errors: Check your source file. It should
be exactly as presented here.
Check the Sun Web site for additional suggestions.
7. Now run your program, using the Java runtime that comes with the SDK:
java HelloWorld
8. If you've done everything correctly, your MS-DOS window should look
like Figure 2.2.
FIGURE 2.2
The Hello World! program.
Search WWH ::




Custom Search