Using Java on Your Home Computer

Revision 2.0

1. What you need

Recommended System

NB: May run acceptably on lesser systems, however it's not recommended

Also Note: For 27-160 the Linux JDK is not supported

IMPORTANT NOTE: When downloading files remember where you save them!

1.2 Java Development Kit 1.1.7 for Windows

Download it from http://java.sun.com/products/jdk/1.1/download-jdk-windows.html

The CD-ROM that was included on the back of the back cover of your textbook comes with JDK 1.1.6. In the following instructions simply substitute JDK 1.1.6 for 1.1.7

The only required component is the JDK 1.1.7 (Java Development Kit 1.1.7), but if you wish you can also download the documentation and the JIT (Just In Time compiler - speeds up performance of code which is executed often in you programs) add-on.

1.3 CCJ Package

Download it from http://www.horstmann.com/ccj.html

1.4 A Text Editor with Line Numbering

You have many options here but keep in mind that only SpiceEdit, Notepad, Notepad99, and DOS EDIT will be supported by the 27-160 TA's. Notepad doesn't have line numbering so it is probably a bad choice. In addition, in order to use the files you create under Notepad you have to rename them (because Notepad will automatically add .txt to your filename). DOS EDIT has line numbering but again will require file renaming (since it only understands old style 8-letter name plus 3-letter extension form of naming under Windows NT - under Windows 95/98 you won't have that problem). SpiceEdit on the other hand doesn't come with you system and you will have to obtain and install it. If you think you want it, check out http://www.uoguelph.ca/~murphyb/ (don't forget to download the required libraries or you won't be able to run it). It is rather large, and may not be completely stable. Notepad99 suffers from the same problems as SpiceEdit for download and installation. If using Win 95/98 DOS EDIT is probably the best choice of the ones available.

1.5 WinZip (or equivalent)

In order to install the programs listed above, you will need to download and install a decompression program such as WinZip. WinZip can be obtained from http://www.winzip.com/winzip/index.html/ or your textbook CD-ROM.

2. Installation

2.1 WinZip

To install WinZip simply double-click on the winzip95 file you downloaded from the website, or which you see on your textbook CD-ROM, and follow the directions. In most cases you should be able to do a complete install by simply accepting the defaults and clicking on the Next button for each step.

2.2 JDK 1.1.7

2.2.1 To install the JDK

For complete instructions refer to http://java.sun.com/products/jdk/1.1/installation-win32-x86.html

Double-click on jdk117-win32 which you downloaded and follow instructions.

If you are using the CD-ROM, you may have to unzip the file first. To do so, start WinZip and when you see Next click it once. WinZip will search the folders you specified as your favourites. If the JDK file is not in one of those folders, click on the Search button and choose Search Disk, and set the disk to your CD-ROM, then click Next. Click on the JDK filename and then click Next. Select the location in which you want the installation temporary files to be placed, then click Unzip Now. Open that folder and double-click the JDK install file, or, instead of Unzip Now choose the Install option.

2.2.2 Installing the Documentation

If you have the documentation and wish to install use WinZip as above, except make sure that the folder you are extracting to is the folder created for the JDK (usually something like C:\JDK1.1.7).

2.2.3 Important Post-Installation Information

If you want to be able to run the Java tools while working in any directory, you need to add to your computers PATH variable.

Under Windows 95/98

On C:\ Edit the file AUTOEXEC.BAT

NB: If you want to be able to use the JDK when you boot to MS-DOS as well as from a Windows you need to also edit AUTOEXEC.DOS.

At the end of your AUTOEXEC.BAT file add the following:

PATH=%PATH%; followed by the full path to the folder to which you installed the JDK plus \BIN

e.g. Assuming you installed the JDK to C:\JDK1.1.7 you would now have PATH=%PATH%;C:\JDK1.1.7\BIN

Reboot: After editing your AUTOEXEC file you will need to reboot for your changes to take effect, however if you are going to be using CCJ (i.e. you're in 27-160) do this when indicated in the CCJ install instruction instead of now.

Under Windows NT

Go to Start|Settings|Control Panel|System Environment tab and add the location of the JDK binaries (C:\JDK1.1.7\BIN in the example above) to the PATH variable .

(So the path would might read C:\WINNT;C:\WINNT\SYSTEM32;C:\JDK1.1.7\BIN)

2.3 CCJ Files

Full instructions my be found at: http://www.horstmann.com/ccj/help.html

Unzip the ccjfiles.zip file into the directory you would like to store the CCJ Toolkit files in. C:\CCJ is recommended and C:\JDK1.1.7 (or C:\JDK1.1.7\BIN or \LIB) are to be avoided.

Add a CLASSPATH environment variable pointing the CCJ files:

Under Windows 95/98

Edit the C:\AUTOEXEC.BAT file as for adding the PATH statement


Assuming you installed the JDK to C:\JDK1.1.7 and the CCJ Toolkit to C:\CCJ.

NB: If you want to be able to use the JDK when you boot to MS-DOS as well as from a Windows you need to also edit AUTOEXEC.DOS.

Reboot: In order for your changes to take effect you will need to reboot Win95/98

Under Windows NT

Add a CLASSPATH environment variable (Start|Settings|Control Panel|System ...)

With the value C:\JDK1.1.6\LIB\CLASSES.ZIP;.;C:\CCJ\CLASSES.ZIP assuming the JDK is installed to C:\JDK1.1.7 and the CCJ Toolkit is in C:\CCJ

2.5 Quick Summary of SpiceEdit Install

2.6 Programmer's File Editor (PFE)

This is a very good editor, but it is not supported for the purposes of 27-160. It can be found at http://www.lancs.ac.uk/people/cpaap/pfe/

2.6.1 Quick Summary of PFE Install

  1. Using WinZip "CheckOut" PFE to the folder of your choice (e.g. C:\PFE)
(Make sure you have "Create Icons for Programs and Documents Only" checked)
  1. Close WinZip: DO NOT delete CheckOut folder
  2. Look at Options|Preferences and set PFE up to work to your preferences
HINT: If you are an advanced user you can set up PFE to operate differently depending on the type of file you are working with. (i.e. PFE can be a good replacement for Notepad for .txt files and still be a good Java editor for .java files). To do this look at Options|Edit Default Modes and use Mode Groups.

You can also set PFE to start automatically on double-clicking on file-types of your choice. Take a look at Options|Preferences|Associations


3.1 The CD-ROM that came with the textbook is detected as an audio CD

This appears to be a problem with outdated drivers. If you are using Win95 drivers with Win98 you may have a problem. (The same applies to Win3.1 drivers with Win95). If you are certain this isn't your problem check the CD on another machine. If it doesn't work return it to the bookstore since its defective. If it does work you have technical problem with your machine. A possible workaround is saving from CD-ROM to other media and installing from the other media (e.g. if both you and a friend have an LS drive).

3.2 I followed the instructions exactly and my installation doesn't work

  1. The first version of this install guide contained errors. Reread this document and note the changes (most likely in the PATH and CLASSPATH statements). Also the latest version of this document is always available from http://www.geocites.com/SiliconValley/1724/tech_docs/ccj_java_install.html
  2. You need to reboot after modifying your AUTOEXEC.BAT in order for the changes you made to take effect.
  3. See 3.3

3.3 I followed the instructions, reread the FAQ, and my Java program still won't compile/run

Make sure the program is correct. Test it in the lab or on a friend's (working) machine, then make sure you use the saved copy of the working program on your own machine. If it works on another machine but not yours send the TA a copy of the error message and program in question. If it doesn't work on the other machine the problem [with the program] probably isn't the installation but a programming error (which is beyond the scope of this document).

3.4 I don't understand something in the guide

E-mail a TA or the author of this guide <perran@geocities.com> for assistance.

3.5 How do I upgrade from JDK1.1.6 to JDK1.1.7

You probably don't need to, and doing so requires download an 8MB+ file just like an original installation.

4 Changes

4.1 Changes Since Revision 1.1/1.0

Unknown - Revision history added in Revision 2.0

4.2 Changes Since Revision 1.2

 © 1999 Daniel F. Dickinson <perran@geocities.com>

Best Viewed With Any Browser

This page accessed