|
Computing at Home
CSE 142/143
|
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
-
Jeva: a Java interpreter
-
BlueJ: a Java development environment
-
Local CSE142/143 libraries
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.
Java SDK
You must first install the Java 2 Platform from Sun Microsystems. It's the
Standard Edition, version 1.3 or to be precise, 1.3.1_03 -- Sun keeps releasing
bug fixes with new numbers. There is a later version, 1.4. Please do
not use 1.4 at this time. It is quite new, and apparently has some
incompatibilities with other software that depends on the Java SDK.
Go visit
the Java2 home page (really, the
page where you can download the SDK1.3 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 the Riley textbook 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 Riley CD, and then follow the
instructions.
A couple of notes:
- It may help to install it in a location where the pathname has NO spaces.
For example, don't use C:\Program Files\etc\etc, but instead something like C:\jdk1.3 or C:\jdk1.3.1
(the default names picked by the JDK 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 JDK when you do it (e.g. "C:\jdk1.3.1"). You'll need to enter this
when you install BlueJ, below.
- Be sure you install the Java Development Kit (JDK). There
is a smaller package called the Java Runtime Environment (JRE), which is
a subset of the JDK that includes files needed to run, but not create,
Java programs. The JRE is not adequate for our purposes -- be sure
to get the JDK.
- A large part of the JDK distribution is source
code. 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.)
Jeva and the Remaining Software
Here are instructions for installing the remaining courseware. This is the
same setup that is installed in the UWired general labs, including MGH and OUGL.
-
Be sure you have already installed the Sun Java 2 JDK first (see above).
-
Create a folder for the CSE142/CSE143 files. In these instructions,
we'll assume it's named C:\CSE. You can use any other folder as
long as the name of that folder, and any containing folders, do not have
spaces (i.e., don't put your files in C:\Program Files, for example).
-
Open C:\CSE and create two folders inside named tools and
lib.
-
Download the following files and place them in C:\CSE\lib: uwcse.jar
jeva.jar
-
If you're running on a Windows system, download the one of the following files that corresponds to the course that
you're taking and place it in C:\CSE\tools: jeva-142.bat
OR jeva-143.bat. If you're downloading to a Unix system,
then download one of the following files instead: jeva-142.sh OR
jeva-143.sh; after downloading
you'll need to edit the JEVADIR environment variable setting in the .sh file to match where you installed your course software (whatever your
equivalent of C:\CSE is). If you're
downloading on Mac OS X (earlier Mac systems don't support Java), then download
the appropriate Unix .sh script; if you'd like to enable double-clicking on its
icon to
run it, then rename it to have a .command extension.
-
Try to run jeva-142.bat (or jeva-143.bat) by double-clicking on it. [Note: your Windows
configuration may hide the .bat extension.] If it works, giving a
prompt like "JevaESCLI-0>", great; type control-C to exit or click
the close button. If
it doesn't work, but instead prints out messages about being out of environment
space (as it did when I tried to run it under Windows 98), then right-click on
jeva-142.bat (or jeva-143.bat), select Properties, click on the Memory tab, set Initial
environment to 1024, and click OK. Retry running jeva-142.bat (or
jeva-143.bat); it
should give a nice Jeva prompt now.
BlueJ
-
Be sure you have installed the Sun SDK first. You don't need to have Jeva
installed already, however.
-
BlueJ is available from www.bluej.org.
Download the latest BlueJ version (currently 1.1.6) 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.
-
Double-click bluej.jar to install BlueJ. 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.3.1.
Special Libraries for CSE142/143
-
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 to use the new
libraries.
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.
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. 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.
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.
Last updated 04/02/2002 09:07 PM