|
|
|
|
Introduction
This document should help you get set up for working on a home computer. You'll
need to install the following software:
- The Java SDK from Sun (new version this quarter)
- DrJava: a Java interpreter and development environment (new
this quarter)
- BlueJ:
another simple Java development environment
- Local CSE142/143 libraries
The software setup is the same for both CSE142 and CSE143 this quarter
- these instructions apply to both courses.
We're not particularly religious about which development environment you use. You
can do most 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 recent Java 2 programming environments like Eclipse, JBuilder,
CodeWarrior (commercial
only),
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.
Java SDK
You must first install the Java 2 Platform from
Sun Microsystems. We
will be using the Standard Edition, version 1.4 or to be precise, v 1.4.0_03.
A more recent version, 1.4.1 also should work for this course, however,
in our testing, we have discovered that 1.4.1 crashes on some laptops and
does not include any new features that are needed in the course.
Sun keeps releasing new versions
of Java with incremental bug fixes and other improvements. If you want
to try 1.4.1 or another later version, be our guest, but if you have problems,
you may find that switching
to
1.4.0
will
solve
them.
Go visit the Java2
home page (really, the page where you can download the Software
Development Kit (SDK) 1.4). Currently, Sun's Java 2 SDK can be installed
and run on Windows 95/98/NT/W2000/XP, as well as a variety of Unix
variants,
including
Linux and Sun/Solaris. Java 2 version 1.3 (not 1.4) 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. Version 1.4 may become available for Mac OS X during
the quarter; but in the meantime, Java 1.3 is suitable for all of the
assignments in CSE142 and most of the work in CSE143. Java
2 is not available for the classic Mac OS (OS 9 and earlier).
The distribution is big, roughly 36MB, so if you're connecting by slow
modem, it's going to be a pain. DSL or CableModem users should have an
easier time. You can always download it onto a UW lab machine with a
CD burner and make a copy that you can carry home to install.
To install, double-click on the j2sdk-XXX.exe installer
program that you downloaded from Sun, and then follow the instructions.
A couple of notes:
-
We strongly recommend you install Java SDK in the the default directory
suggested by the installer, which is C:\j2sdk1.4.0_03 for
version 1.4.0_03.
By doing that, you can keep your environment consistent with IPL
machines and most students and TAs' environment. And you should be
able to download the tools from us and run them directly without
the need of modification. If you already installed Java SDK in another
directory, we recommend you delete it using the add/remove programs
control panel, then run the installer and let it put the SDK in the
default directory. (Do NOT just rename the original directory. It
will NOT work). If
you
really
want
to
use
other directory
names, you may have to make changes in other parts of the installation
to match.
-
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. You don't
need to install the source code, or the demos, but install everything
else. (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.)
Folders and UW CSE Software LIbrary
-
Be sure you have already installed the Sun Java 2 SDK first (see
above).
-
Create a folder for the CSE142/3 files. We strongly recommend
you use the name C:\CSE. It will make set-up much easier.
-
Open C:\CSE and create two folders inside named exactly tools and lib.
- Download the following file and place it in C:\CSE\lib: uwcse.jar
- Instructions for configuring the other tools (DrJava and
BlueJ) to use the UW CSE library files are given below.
DrJava
- Be sure you have installed the Sun Java SDK first. You don't need
to install BlueJ or other additional tools to use DrJava.
- DrJava's web site is http://drjava.sourceforge.net/. You
want to install the latest stable release.
- (Windows, Unix, and Linux) Download the drjava-stable-XXX.jar file by clicking on the download button. This file can be placed
anywhere,
but we strongly suggest putting it
in the C:\CSE\tools directory.
- (Mac OS X) There is a special version of DrJava for Mac OS X.
Download the drjava-stable-XXX-osx.tar.gz file that can be found
on the page with the full
list of DrJava files. This should usually be put in your
Applications folder.
- Start DrJava.
- (Windows, Unix, Linux) On most of these systems, you should be
able to run DrJava by double-clicking on the drjava-xxx.jar file.
On windows, if you are asked to pick the program to run DrJava,
pick javaw.exe, which is found in the C:\j2sdk1.4.0_03\bin folder.
For future convenience, if you're using Windows, you might want
to create a shortcut to the DrJava file and place it on the desktop
or in
some
other
convenient location. Right-click on the DrJava file and select create
shortcut from the popup menu.
- (Mac OS X) DrJava runs as a normal application. Double click
to start it.
- The first time you start DrJava on Windows and some other systems,
you may get a message saying "DrJava cannot find any Java compiler.
Would you like to configure [it]..." Click on yes. Assuming you've
used the default Java SDK installation, use the file dialog to select C:\j2sdk1.4.0_03\lib\tools.jar.
DrJava should then open it's main window. This extra step should not
be necessary on Mac OS X systems.
- To verify that DrJava is working, enter the following line,
including the semicolon, in the bottom window pane to the
right of the ">" prompt.
System.out.println("Hello");
Hit return (enter) and DrJava should
display the word hello below the line that you typed.
- Tell DrJava where it can find the CSE142/143 library files. This
only needs to be done once.
- Start DrJava if it is not already running.
- Select Preferences from the Edit menu.
- Select the Resource Locations tab if it is not already
selected and click Add.
- In the file dialog that appears, locate the file C:\CSE\lib\uwcse.jar,
click select, then click ok.
- To test that the new libraries are installed correctly, enter
the following two lines of code at the bottom of the screen.
import uwcse.graphics.*;
GWindow w = new GWindow();
If everything is installed properly, an empty window named DemoWindow should appear on the screen.
- If you want to use the new assert statement that was added
to Java in version 1.4, start DrJava if it is not already running,
select Preferences... from
the Edit menu, select the Miscellaneous category,
then click the Allow assert keyword in Java 1.4 check
box in the middle of the panel, and click ok. This only needs
to be done once. DrJava currently does not support the use of assert in
the interactions window at the bottom of the screen, but you can use
it in any new classes that you create.
BlueJ
- Be sure you have installed the Sun SDK first. You don't need to
install DrJava or other additional tools to use BlueJ.
- BlueJ is available from www.bluej.org.
Download the latest BlueJ version (currently 1.2.2) from their distribution
page. The download is around 1MB, so it's reasonable to download
even over a modem. The bluej.jar file can be placed anywhere.
- Install BlueJ
- (Windows) Double-click on the bluejsetup-122.exe file that you
downloaded above. You can install BlueJ anywhere, but we suggest
you put it in the CSE\tools folder. When the installer asks you where
to install BlueJ, open the c:\cse\tools folder, then select next.
- (Other systems) Follow the installation
instructions on the BlueJ
web site..
- Start BlueJ
- (Windows) Run BlueJ from the Start>All Programs menu, or double
click the BlueJ icon that the installer placed on the desktop.
- (Other systems) Double-click the bluej file created during installation.
- Tell BlueJ where it can find the CSE142/143 library files. This
only needs to be done once.
- Start BlueJ if it is not already running.
- Select Preferences... from the Tools menu then click on the Libraries tab.
- Click the Add button and select the file C:\CSE\lib\uwcse.jar.
Click open, then click ok.
- Click ok once more and then quit BlueJ. Restart to use
the new libraries.
- To test that the new libraries are installed correctly, you can
download the file UWCSETest.java and
save it in a folder (you may need to right-click on the link and
select
"Save Target as...",
then save the file as UWCSETest.java). Run BlueJ and select Open
non-BlueJ from the File menu. Select the folder containing
the UWCSETest.jave file (not the file itself) and click ok. Click
the compile button. If that works, the libraries are successfully
installed.
- If you want to use the new assert statement that was added
to Java in version 1.4, start BlueJ if it is not already running, select Preferences... from
the Tools menu, select the Miscellaneous tab if necessary,
then click the Enable JDK 1.4 features (assertions) check
box in the middle of the panel, and click ok. This only needs
to be done once.
Textbook Libraries
As you read the textbook, you may come across references to special
Java libraries and sample code that the textbook authors have created.
If these are needed for your course, you will receive specific instructions
for how to use them with your assignments. 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.
Old School
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
Box 352350
Seattle, WA 98195-2350
[comments to cse142-webmaster]
|
|