|
|
| |
Introduction
This document should help you get set up for working on a home computer.
You'll need to install the following (free!) software:
- The Java SDK
- BlueJ: a Java development environment (or
DrJava, an open-source IDE). It's also
possible to get by without either.
- Local CSE142/143 libraries
Please also read our comments about libraries you may find with
various Java books.
We're not particularly religious about which development environment you
use. You can do many of the assignments in this class with very simple
tools -- see the end of the document for a low-tech (yet surprisingly powerful
and useful) approach -- or with other Java 2 programming environments like
JBuilder, CodeWarrior, and so forth. You can't use Microsoft J++;
however; although it is a well-designed Java environment, it has not been
updated in several years and does not support the current version of the
the Java language and libraries.
If you want to work at home, you are on your own to some extent in terms
of getting stuff set up. Ask friends, read documentation, post a question
on the bulletin board, ask us -- but we can't be guaranteed to have an
answer. Ultimately you're on your own with your home computer. The lab
is always available as a fallback.
Regardless of the development environment that you use, the code you
turn in should only rely on the standard Sun Java libraries, and libraries
that are distributed by us. Your code should not rely on "wizards", special
libraries that might be provided with your environment, or code that comes
from the Internet or friends. The programs you give us will be compiled
and run using our set-up.
You must first install the Java 2 Platform from Sun Microsystems.
It's the Standard Edition, version 1.4 or to be precise,
1.4.0_02 -- Sun
keeps releasing bug fixes with new numbers.
CAREFUL! The current Sun version, and
the default when you go to the download web page, is 1.4.1. This
version apparently does not properly with Bluej, especially on Windows XP.
Make sure you load 1.4.0_02.Go visit the Java2 home page
(really, the page where you can download the SDK1.4 from). Currently,
the Java 2 SDK can be installed and run on Windows 95/98/NT/W2000, as
well as a variety of Unix variants, including Linux and Sun/Solaris. Java
2 version 1.3 is included with Mac OS X, so you should be able to run
the course software on OS X without having to install Java 2 first.
Java 2 is not available for the classic Mac OS (OS 9 and earlier).
The distribution is big, roughly 31MB, so if you're connecting by slow
modem, it's going to be a pain. DSL or CableModem users should have an
easier time. The CD provided with many books includes the Java
2 SDK. To install, double-click on the j2sdk-XXX.exe installer
program that you downloaded from Sun, or that's on the CD supplied with
the book, and then
follow the instructions. A couple of notes:
- The CD version might be earlier than Java 1.4. If it is, don't use
it. We will begin to use some 1.4 features early in the course.
- You must install into a location where the pathname has NO
spaces. For example, don't use C:\Program Files\etc\etc, but instead
something like C:\sdk1.4.0 or C:\j2sdk1.4.0_02 (the default names picked
by the SDK installer). Sometimes other software is not very tolerant
of the spaces in the pathname. Our course software doesn't seem
to have a problem with spaces in path names, but some Unix-based tools
have problems.
- It's also worth writing down the name of the directory where you install
the SDK when you do it (e.g. "C:\j2sdk1.4.0_02"). You'll need to enter
this when you install BlueJ, below.
- Be sure you install the Java Standard Edition Software Development
Kit (J2SE SDK), formerly known as the Java Development Kit (JDK).
. There is a smaller package called the Java Runtime Environment
(JRE), which is a subset of the SDK that includes files needed to run,
but not create, Java programs. The JRE is not adequate for our
purposes -- be sure to get the SDK.
- A large part of the SDK distribution is source code. If disk
space is limited on your computer, you don't
need to install the source code, or the native library header files,
or the demos; only the program files. (You'll eventually get the
option of what you want to install when you run the j2sdk-XXX.exe
installer program that you downloaded from Sun.)
- Go to Sun's
Java 2 SDK documentation page and bookmark it. If disk space
is not a problem on your machine, download and install the documentation
from Sun. The part you'll probably use the most is the Java 2
Platform API Specification, referred to by most people as "the Javadoc
for the standard Java libraries."
- Be sure you have installed the Sun SDK first.
- BlueJ is available from www.bluej.org.
Download the bluej.jar file from their distribution
page. Unless your instruction suggests otherwise, go for the most
recent BlueJ version.. The download is around 1MB, so it's reasonable to download
even over a modem. The bluej.jar file can be placed anywhere.
(Note: Bluej is updated fairly frequently; it may be necessary to
install a later version even this quarter).
- On most systems, once the Java SDK has been successfully installed,
you can install Bluej by simply double-clicking the bluej.jar. You can install
this anywhere; for the rest of these instructions, we'll assume that
you're installing it in C:\CSE\tools\bluej. There may be
a bug in the installer that prevents the browse button from
working properly; if so, you'll have to manually enter C:\CSE\tools\bluej
in the field for the install directory name. You also have
to say where you installed the Java JDK, e.g., C:\jdk1.4.
- In addition to its features as an environment for writing and
debugging programs, Bluej has two other features worth exploring.
One is the ability to create Javadoc documentation files from your Java
source files. The other is the ability to package an entire
project as a .jar file. Some projects in the course may require
you to do one or the other of these.
- The library uwcse.jar contains class for I/O and graphics. In
general, the classes are much quicker and easier to use than the native
Java libraries. Download the
uwcse.jar file; the recommended place for it is in the directory
C:\CSE\lib\. It is not necessary
to unpack the file.
- You must have the Sun SDK and BlueJ successfully installed before
continuing.
- Open C:\CSE\tools\bluej and click on bluej.bat to start
BlueJ. (If you get an out-of-environment-space error, repeat the
technique from step 6 above to increase the .bat file's environment
space.) You need to tell BlueJ where it can find the CSE142/143 library
file. Do the following:
- Choose Tools>preferences and click on the Libraries
tab in the dialog box that opens.
- Click add and then navigate to and select the file C:\CSE\lib\uwcse.jar.
Click open (or double-click on uwcse.jar), then click
ok.
- Click ok once more and then quit BlueJ. Restart
Bluej to put the change into effect.
The course software should be installed at this point. If you'd like,
you can create shortcuts to files bluej.bat and jeva.bat,
which you could put in more convenient places, like the desktop. Be
sure to create shortcuts; don't move the .bat files themselves. If
you move them, things are likely to break.
This program is quite new. It is similar to Bluej in spirit.
Bluej and DrJava each have features the other lacks. We haven't
written special instructions yet for DrJava, but if you want to try it, go
to the DrJava web site.
You want the latest drjava-stable release. Like Bluej, DrJava
requires that you first have the Java SDK installed.
As you read the textbook, you may come across references to special Java
libraries and sample code that the textbook authors have created.
You do not need these for CSE142/143. Please do not use them
for assignments that you turn in. Of course, you are welcome to
study the code samples in the textbook. As you do, please keep in
mind that they may use features or libraries which will not be discussed
in our course.
Geek Power: Use the Command Prompt
If you install the Java SDK on your home machine, you can actually build
really interesting programs without any extra software. The SDK comes with
a compiler, javac that you can use to compile programs, and a functional
debugger, called jdb. You'll want to use a good editor to write
your programs, the best of which is emacs (read more
about emacs). There is a better (faster) compiler available called jikes,
from IBM. The advantage of using this approach is while it may not be quite
as easy as an integrated environment, you'll learn to use some tools that
you can use in many other contexts as well.
|
 |
Department of Computer Science & Engineering
University of Washington
[comments to cse143-webmaster]
|
|