Installing Java JDK 1.0.2 on Your Home Computer

There are two versions of Java available from Sun, JDK 1.0 and JDK 1.1. The JDK 1.0 is an older version of Java, and the JDK 1.1 is a newer version. Our textbook is written for the new version, and many of the sample programs in the book will not work with the older version. This page gives instructions for installing the older version, JDK 1.0. The reason for making the old version available is that the old version is small (about 4 MB) while the new version is quite large (about 9 MB), so it is easier to download the old version with a slow modem. So if you should have trouble trying to download the new version, you can try this old version instead. But this old version of Java will only be good up until we get to Chapter 6 of the textbook. If you want to install the newer version of Java, follow the instructions back on this other page.

Step 1:
If you do not have the program WinZip already installed on your home computer, then you should install it first. Download the Windows 95 version from the WinZip Download Page; follow the instructions on that page to install WinZip.

Step 2:
Download the Java compiler from Sun. The complete name for this compiler package is the Java Developer's Kit (JDK) 1.0.2. Everything you need is in one file that is about 4MB in size. Sun provides a page of installation instructions, but I suggest that you follow the instructions on this page. Download the distribution file to your C:\ directory by clicking on the following URL; have your browser save this file in the C:\ directory:
ftp://ftp.javasoft.com/pub/jdk1.0.2/JDK-1_0_2-win32-x86.exe

Step 3:
Now that you have the distribution file JDK-1_0_2-win32-x86.exe in your C:\ directory, find it in a directory window and double click on it. It will automatically open a DOS window and create a directory C:\java into which it will place all the Java files. After it has done this, you can delete the distribution file JDK-1_0_2-win32-x86.exe to save space if you wish.

Step 4:
Now you need to download a DOS batch file, javaset0.bat. Place this file in your C:\ directory (not in the C:\java directory). When you click on the above link, if your browser asks where to save the file, save it in C:\. If your browser displays the batch file, then click on the browser's "File" Menu, click on the "Save As" command, and save the batch file in C:\. After you have javaset0.bat in your C:\ directory, you can, if you want to for convenience, rename it to javaset.bat. From now on I will refer to the this file as javaset.bat.

Step 5:
You need to create a directory C:\cs125 on the C: drive. To create C:\cs125, open C:\ in a directory window, click on the "File" Menu of this directory window, and choose "New" -> "Folder". Call the new folder cs125.

Step 6:
Download this very short Java program into the C:\cs125 directory that you created in the last step. Either right click on the previous link and tell Netscape where to save the file, or click on the previous link, which will display the file in Netscape, and then use the Netscape "File" -> "Save as ..." menu item to save the file.

Step 7:
Now you are ready to try out Java. But first make sure that you have read Chapter 2, pages 10-20, of the "Java for Students" textbook. To compile the short Java program that you just downloaded in the last step, use the Start Menu to start up a "MS-DOS Prompt" window. At the DOS prompt, type the DOS command
cd C:\cs125
which will move you to the directory C:\cs125. Now enter the command C:\javaset (which should respond with a line of output beginning with the word PATH). Now enter the command javac (you should get a usage message back from the java compiler). Now enter
javac Hello.java
(you should NOT get any output back). Now type
java Hello
(you should get the output Hello, World!).

Step 8:
If the last step was successful, then you are ready to try out your own Java program. To familiarize yourself with the Java compilation process, follow the directions on pages 14-17 of the "Java for Students" textbook. For an editor you can use either Notepad (use the "Start Menu" -> "Run" menu item and enter the command "notepad"), or you can use the PFE or TextPad editors (see Step 9 below).

Step 9:
This last step is optional. If you would like to, you can download a good text editor to use instead of Notepad for editing your Java source files. A good freeware editor is the Programmer's File Editor (PFE). Since PFE is freeware, you can use it for as long as you wish, without having to pay. Use the following link to download the distribution zip file.
The Latest Version of PFE
Download the 32 Bit Edition of PFE. You can either download the distribution zip file onto your desktop, or download it onto the C:\ drive. Once you have the distribution zip file, create a directory C:\pfe and extract the zip file into it. You need to create your own program group for the start menu, or better yet, put a shortcut to PFE on your desktop and/or in the folder "C:\Windows\Send To".

A very good text editor is TextPad. TextPad is shareware; you can download and use it for free for a trial period, but then you are supposed to pay a modest shareware fee if you plan to continue using it. Use the following link to download an installation file.
ftp://ftp.textpad.com/pub/tpe32325.exe

NOTE:
When you are editing your Java source files with any editor, remember to save your work frequently (at least every 15 minutes), otherwise it may be Abort, Retry, Ignore?


Return to the main Java page.
Return to the CS 125 home page.


compliments and criticisms