Working at Home


Introduction

This document should help you get set up for working on a home computer.  We'll use the following two tools in this class:

  1. Jeva: a Java interpreter
  2. BlueJ: a Java development environment

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.  (But not Microsoft J++; although it is a well-designed Java environment, it has not been updated in several years and does not support Java 2.)

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, ask us -- but we can't be guaranteed to fix things for you. 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" or special libraries that might be provided with your environment. 

Requirements

The tools we run all require that you first install the Java 2 Platform (Standard Edition, version 1.3 or 1.3.1) from Sun Microsystems. Go visit the Java2 home page. 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. 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 modem, it's going to be a pain. DSL or CableModem users should have an easier time. Fortunately, the CD provided with the textbook includes the Java 2 SDK. Usually, after downloading, the installation is pretty straightforward. A couple of notes:

Be sure to install it in a location where the pathname has NO spaces (not: C:\Program Files\etc\etc; something like C:\jdk1.3 or C:\jdk1.3.1 (the default names picked by the JDK installer) will make your life much easier). Sometimes other software is not very tolerant of the spaces in the pathname.

It's also worth writing down the name of the directory where you install the JDK when you do it (eg. "C:\jdk1.3.1"). You may need to remember this later.

Be sure you install the full Java Development Kit (JDK).  There is a smaller package called the Java Runtime Environment (JRE), which is a subset fo 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.

Jeva and BlueJ

Here are instructions for installing the remaining courseware.  This is the same setup that (will be) installed in the UWired general labs, including MGH and OUGL.

  1. Be sure you have already installed the Sun Java 2 JDK first (see above).
  2. Create a folder for the CSE142 files.  In these instructions, we'll assume it's named C:\CSE142Support. 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 CSE 142 files in C:\Program Files, for example).
  3. Open C:\CSE142Support and create two folders inside named tools and lib.
  4. Download the following two files and place them in C:\CSE142Support\lib:  cse142.jar  jeva.jar
  5. Download the following file and place it in C:\CSE142Support\toolsjeva.bat
  6. BlueJ is available from www.bluej.org.  Download BlueJ version 1.1.4 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.
  7. Double-click bluej.jar to install BlueJ.  You should install this in your support tools folder.  There is a bug in the installer that prevents the browse button from working properly; you'll have to manually enter C:\CSE142Support\tools\bluej in the field for the install directory name.
  8. Open C:\CSE142Support\tools\bluej and click on bluej.bat to start BlueJ.  You need to tell BlueJ where it can find the CSE142 library files.  Do the following:
    1. Choose Tools>preferences and click on the Libraries tab in the dialog box that opens.
    2. Click add and then navigate to and select the file C:\CSE142Support\lib\cse142.jar.
    3. Click open, then click ok twice.  Finally, quit BlueJ and 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 bulej.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 do, things are likely to break.

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 (see our help pages about this editor). 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.