CS 120: Computer Science I
OPTIONAL - Laboratory OLD - OPTIONAL
Installing the JDK on a Windows PC
Overview
This document briefly describes the procedure to install the Java Development
Kit (JDK) on a Windows PC, as an aid to anyone wishing to run the JDK on
their own. This is not required for CS120, and if you choose to install
the JDK and work elsewhere you must assume responsibility for getting it
to work, and dealing with any problems that arise as a result.
The
JDK is installed on the Suns in the Computer Science Laboratory, and your
homework assignments will be graded on that system, so you are strongly
encouraged to make sure your assignments compile and run correctly on the
Suns.
Getting the JDK
Our textbook (Java Gently, 2nd edition, by Judy Bishop) is written
for Java version 1.1, and as of August 1998 the CS Lab is running version
1.1.5 (the 5th release of version 1.1). There should be only minor differences
in 1.1.3, 1.1.5, 1.1.6, etc. Version 1.2 may be significantly different;
use it at your own risk!
The JDK software is over 8.5 MB in size, and the JDK documentation is
over 3.0 MB; downloading over 11 MB may take a long time, depending on
the speed of your Internet connection.
If you have a reasonably fast Internet connection, you can download
the JDK directly from Sun Microsystems,
at http://www.java.sun.com/products.
Choose the current version of the JDK, which will probably be in boldface
at the top of a section titled Development Kits and Runtimes. The
next page will let you choose which hardware platform you wish to use (probably
Win32).
This should take you to a page where you can download the
JDK Software
and the JDK Documentation.
If you do not have a fast Internet connection, you can borrow a CD-ROM
that has everything on it (many thanks to Connie Troiano for providing
the CD-ROM), and copy the two files from the CD-ROM to your local hard
disk. Please return the CD-ROM promptly so that other people can use
it.
If you prefer to run Java under Linux, check out the Java Linux page
at http://java.blackdown.org/java-linux.html.
The setup for Java under Linux is somewhat different than under Windows,
so you're on your own. Good luck!
Installing the JDK
However you obtained them, you should now have two large files containing
the JDK and documentation. Their names should look something like
jdk116-win32.exe
(for the JDK) and jdk116-doc.zip (for the documentation).
To install the JDK, execute the .exe file (probably
by double-clicking on it). Windows will take you through the installation
process one step at a time; the default answers should be OK. Be sure to
read the notes at the end of the installation; they tell you how to modify
your path so you can run the JDK.
To install the documentation archive you will need a program like Stuffit
Expander, which converts the .zip file into a directory
containing all of the documentation. Sometimes the operating system can't
unpack all of the documentation; it complains that pathnames may be too
long. You shouldn't need the documentation very much for CS 120, since
we're not going to be using many of the specialized packages. The documentation
is also available over the WWW if you can't install it locally on your
computer.
Running the JDK
Once you have the JDK and have set your path correctly, you should be able
to open an MS-DOS Prompt window (from the Programs menu),
and run javac and java just like you use
a Terminal window under Unix. Like Unix, you will need to use a
text editor to create and save your files in a directory somewhere, and
then use the MS-DOS window to compile and run your program. Choose your
text editor carefully; some editors automatically append a particular suffix
to your file. Other students have had trouble with Word and WordPad, and
have had success with Edit (under DOS). If you aren't familiar with DOS
commands, you should consult your documentation; some of the commands are
similar to Unix commands, but there are also numerous differences.
Summary
This page has provided an overview of how to obtain and install the JDK
on a Windows PC. If you decide to do this, you are responsible for making
it work, and for dealing with any problems that arrive. If you have suggestions
for improving this tutorial, please let me know.
This page is NOT maintained and is here simply for information purposes.