UW Home     CSE Home   Announcements    Message Board    Contact Info 

 
 

How to Work from Home

You will need to install two pieces of software: The Java Development Kit (JDK) and the DrJava editor. The directions differ based on your operating system.

Windows
Mac
Linux
 
Useful Options for DrJava and Your Operating System
Comparing Text Files


Windows users:

1) Install Java Development Kit (JDK)

http://java.sun.com/javase/downloads/index.jsp

Follow the above link and click the "Download" button next to the "JDK 5.0 Update 9". (NOT the "with NetBeans 5.0" link or the "with Java EE" link or others). Accept the License Agreement and choose the "Windows Offline Installation, Multi-language" file:

jdk-1_5_0_09-windows-i586-p.exe

Once you have finished downloading this file, double-click it to install it. You can choose all the default options during installation.
 

2) Download DrJava editor

http://drjava.net/

Find the section labeled "Current Stable Release," then click the button labeled "Download Windows App." You will be taken to a download page that lists many Hosts and Locations. Pick one of the locations in North America and press its Download link on the right side of the page. Click the link to download the file, whose name will be drjava-stable-20060918-1737.exe. Save the file to your Desktop or another convenient location.

Once the file is downloaded, examine your desktop and double-click the drjava-stable-20060918-1737 file to run DrJava. (DrJava does not need to be installed -- the file you download is the actual DrJava program.)
 

COMMON PROBLEMS:

When you run DrJava for the first time, you may receive an error message about not being able to find a "tools.jar" file. The box asks if you would like to browse for the file. Click Yes. In the file browse window that appears, browse to the following folder:

C:\Program Files\java\jdk1.5.0_09\lib

From that folder, select the file "tools.jar" and choose OK.

 

When you run DrJava, you may receive an error message such as:

java.lang.IllegalStateException: Interpreter JVM exited before registering, status: 0
     at edu.rice.cs.drjava.model.repl.newjvm.MainJVM.slaveQuitDuringStartup(MainJVM.java:689)
     at edu.rice.cs.util.newjvm.AbstractMasterJVM$1.run(AbstractMasterJVM.java:205)

This message can often result from anti-virus or security software that is blocking DrJava from functioning. If your security software pops up a warning about DrJava, tell it to allow DrJava to proceed. (Newer versions of Windows have similar security warnings about allowing DrJava to connect; if Windows pops up a security warning about DrJava, click the option to allow DrJava to proceed.)

 


Mac:

1) Install Java Development Kit (JDK)

Macs with the OS X operating system will have Java available automatically, but you will need to install the latest version of JDK, version 5.0. 

To be able to use the latest Java (Java 5.0), you have to have the Tiger operating system (OS X 10.4 or higher).  If you have an older operating system like Panther, you might want to consider buying the upgrade ($69 at the university bookstore, which is a discounted price).  Even with Tiger, you won't get the new version of Java automatically.  You have to go to this web page to download it:

http://developer.apple.com/java/download/

Download J2SE 5.0 Release 4 (Intel) if you have a newer Intel Mac such as the "MacBook" laptops.

Download J2SE 5.0 Release 4 (PPC) if they have any older Mac such as a PowerBook.
 

2) Download DrJava editor

As for DrJava, there is a Mac version of that, available from the same DrJava web site.

 


Linux:

It's tougher to give an installation guide for Linux because of the large variety of different distributions and architectures. Here is a rough guide that will work for many distributions such as Ubuntu.

1) Install Java Development Kit (JDK)

http://java.sun.com/javase/downloads/index.jsp

Follow the above link and click the "Download" button next to the "JDK 5.0 Update 9". (NOT the "with NetBeans 5.0" link or the "with Java EE" link or others). Accept the License Agreement and choose the "Linux self-extracting file" file:

jdk-1_5_0_09-linux-i586.bin

(If you use a Linux distribution that supports RPM packages such as Fedora Core, you may wish to use the "Linux RPM in self-extracting file" package.)

Once you have finished downloading the JDK .bin file, open a terminal window and execute the file. You may have to give execution permissions to the file:

chmod +x jdk-1_5_0_09-linux-i586.bin
./jdk-1_5_0_09-linux-i586.bin

Running the .bin file extracts the JDK contents. Move these to a directory of your choice. (The rest of this tutorial assumes you have moved the JDK to /usr/lib/jdk/ .)

After installing Java, you will probably wish to add Java's directory to your PATH setting, so that you can run Java commands from your terminal. To do so, edit the file .bashrc in your home directory and add the following lines to the end of it:

export PATH=/usr/lib/jdk/bin:$PATH
export CLASSPATH=.

You should close your terminal and open a new one for the PATH changes to take effect.
 

2) Download DrJava editor

http://drjava.net/

Find the section labeled "Current Stable Release," then click the button labeled "Download Jar File." Choose a download mirror and save the file named drjava-stable-20060918-1737.jar to a convenient location.

Once the file is downloaded, open a terminal window, change directory to the one that contains the DrJava Jar file, and type the following:

java -jar drjava-stable-20060918-1737.jar

 


Useful Options for DrJava and Your Operating System

DrJava - Enable Line Numbers:

If you'd like DrJava to show numbers at the front of each line of your source code, click the following in the main menu of DrJava:

Edit, Preferences...

Now a Preferences window appears. On the left side of this window, click the text Display Options. Some new options will appear on the right. Check the checkbox labeled Show All Line Numbers. Press OK.
 


 

DrJava - Increase Indenting to 4:

The default amount of indentation (when you press Tab) in DrJava is 2 spaces. Many programmers prefer an indentation level of 4 spaces to make the code easier to read. If you'd like to change this value, in DrJava open the Preferences window as described above. On the left side of the Preferences window, click the text Miscellaneous. Some new options will appear on the right. Type your desired indentation amount into the text box labeled Indent Level. Press OK.
 


 

DrJava - Disable Backup Files (CAUTION):

By default DrJava creates a backup file of your program with the extension .java~ every time you save it. If you'd like to change this value, in DrJava open the Preferences window as described above. On the left side of the Preferences window, click the text Miscellaneous. Some new options will appear on the right. Uncheck the checkbox labeled Keep Emacs-style Backup Files. Press OK.

(CAUTION: These backups can be helpful to protect you from accidentally deleting or damaging your program. Only disable them if you are sure you do not want or need this protection.)

 

Enable File Extensions in Windows:

By default, Windows does not show extensions of certain types of files. This can lead to confusion because you may not know which file is your .java program and which is your .class compiled file.

If you'd like to change this value, open My Computer. From the window's main menu, click the following:

Tools, Folder Options...

A Folder Options window will appear. Click the tab labeled View, then find the checkbox labeled Hide extensions for known file types. Uncheck it. Press OK.

Now all files should show their extensions in Windows.

 


Comparing Text Files:

The following programs may also be useful to help you compare text files for differences, such as to compare your program's output against the expected homework output.

To make your Java program's output into a text file, run your program in DrJava, then copy and paste its output from DrJava into a text editor and save the file as a .txt text document.

WinDiff (Windows)

http://www.grigsoft.com/download-windiff.htm

Follow the above link and download the program as a ZIP archive. Inside the archive is the windiff.exe program to execute. To use WinDiff, run the program and click File, Compare Files... and browse to the two text files to compare.

diff (Mac/Linux)

Mac OS X and Linux operating systems contain a command named diff that can compare two text files and output the differences between them. The diff command is executed from a terminal window. If you use a Mac and do not know how to use the Terminal, consider reading a tutorial such as the following:

http://www.macdevcenter.com/pub/a/mac/2001/12/14/terminal_one.html

Within the terminal, the diff command is invoked with two command-line arguments: the names of the files to compare. For example:

diff file1.txt file2.txt

There are several tutorials on the use of the diff command, such as:

http://www.cis.fiu.edu/support/unix/unix-tutorial/util-diff-comp.html