Java Reference
In-Depth Information
In Windows 98, you can use the sysedit function (menu path Start > Run >
Sysedit) to edit the AUTOEXEC.BAT file. Assuming you have installed the SDK to
the default directory (C:\Program Files\Java\jdk1.6.0_03), add a line to the end of
the AUTOEXEC.BAT file that reads as follows: SET PATH=%PATH%; C:\Progra~1\
Java\jdk1.6.0_03\bin . Changing the AUTOEXEC.BAT file requires that you re-
boot your PC.
On Windows ME, XP, Vista, 2000, and 2003, use the System icon on the
Control Panel to modify the environment variable directly. Add the SDK path
( C:\Program Files\Java\jdk1.6.0_03\bin ) to the end of this variable. The source
can be modified with any text editor, including WordPad. Java source files are stan-
dard text files, including line-ending sequences (CR, LF on PCs). WordPad is very
popular for this task because you can save and compile the Java source without
closing down WordPad. Just make sure you save the WordPad files as text files,
rather than as document files. Document files contain additional text formatting
information that is not appropriate for Java. Freeware and shareware text editors
are available on the Web.
Now, it's time to get started.
1. Make a directory to contain your Java files. From the DOS window, you
can create a directory on the C: drive by typing the following:
cd C:\
mkdir java4cobol
2. Change the current directory in your command window to the directory
you just created:
cd c:\java4cobol
3. Using a text file editor, enter this Java source:
public class HelloWorld {
public static void main(String[] args) {
System.out.println ("Hello World!");
}
}
4. Save the source to a file named C:\Java4cobol\HelloWorld.java.
Search WWH ::




Custom Search