CSC 142 Set-Up
Working from Home

Resources Page

Introduction

This document outlines the steps needed to install and configure the software necessary to work on your Java programming assignments for this course at home.

Installation and setup is a three-step process:

  1. Install the Java SE 6 Software Development Kit (SDK).
  2. Install a Java development environment, DrJava.
  3. Install the NsccLibrary graphics library that we will use in this course.

These instructions assume that you are installing in the suggested folders.

You may install these files into different directories. Obviously, you will need to update the instructions to reflect the directories you have chosen for installation. 

Operating System Notes

You can do the work in this course on a variety of computer platforms.  Here is a summary:

  1. Win 32 (Windows 95, Windows 98, Windows NT 4.0, Windows 2000, Windows XP, Windows ME) — This is the recommended platform. This is the platform used in the classroom and in the labs.
  2. Mac OS X — This should work fine. In addition, Java 2 version 1.3 is included with Mac OS X, so you should be able to skip Step 1 if you are running OS X.
  3. Classic Mac OS (OS 9 and earlier) — This CANNOT be used. Java 2 is not available on this platform.
  4. UNIX — Java 2 is supported on several different UNIX operating systems, including Linux and Solaris.

Step 1: Installing the Java SE 6 SDK

To make any of the tools for the course work, you will need to start by installing the Java SE 6 SDK (software development kit). You can download it from the java.sun.com web site. Click here to visit the download site for this version. For Windows, the current version is:

If you have limited connectivity, for example a dial-up connection to the internet, please let the instructor know as soon as possible. Other arrangements will be made.

Once you have the Java SE 6 SDK installation file, run it.

One of the first steps will be selecting installation options. You can simply use all the suggested setting (default settings) in the installation program. Please make a note of the installation directory (Install to), you may need the name later in the process.

From the download site, you can access the installation notes, which include system requirements, installation instructions, and troubleshooting notes.

Step 2: Installing DrJava

Download DrJava from the DrJava website, www.drjava.org. The download is approximately 6.1 MB. You are downloading the executable file.

To run DrJava, double-click the downloaded file. For Windows, this is the drjava-stable-date-build.exe file. For MacOSX, this is the drjava-stable-date-build.ocx.tar.gz file. For Linux and other operating systems, this is the drjava-stable-date-build.jar file. The current, most-recent date-build is 20080904-r4668.

For more detailed installation instructions, see the QuickStart Guide on the DrJava web site.

If you have problems with your installation, check the DrJava FAQ. This provides solutions to problems, as well as a quick overview of some of the features of DrJava.

Note: If you have problems running the Windows application, download and run the Jar file. Once the Java SDK has been installed, it should set up .jar files as runnable. If you have problems, contact the instructor. (There was a bug that was reported and fixed. So, if you have a recent build of DrJava, this should be a non-issue.)

Installing NsccLibrary

Once you have DrJava, you will need to download the NsccLibrary file and install it so that DrJava will be able to access the classes within it.

IMPORTANT NOTE: This library is probably not installed on the machines in the labs here on campus. To be able to work with this library on campus, you will need to download it to your I: drive and install it into DrJava Preferences.

  1. Download NsccLibrary.jar. Save it to a known location on your local disk.
    For the purposes of this discussion, let's assume the file has been saved in the folder C:\CSC142. The site security scripts have been updated so that right-click and selecting Save Link As / Save Target As should now work. This is a Java ARchive file. This file type is used to store / manage a number of Java class files. It allows an entire application or library to be handled as a single file.
    Note: This is a compressed file. Some browsers will download it as NsccLibrary.zip, rather than NsccLibrary.jar. This is not a problem. Just substitute the .zip extension for .jar in the rest of these instruction.
    Important Note: If you are on an Apple Macintosh running OS X, please download NsccLibrary-Java5.jar, rather then NsccLibrary.jar.
  2. Open (run) DrJava. From the Edit menu, select Preferences. The Preferences dialog box will appear. In the navigation area on the left side of the dialog box, select Resource Locations

    Click the Add button which appears below the Extra Classpath listbox. The Select dialog box appears.
  3. In the Select dialog box, navigate to the folder where you stored NsccLibrary.jar. Select this file.

    Click Select to add this file to Extra Classpath and dismiss the Select dialog box.
  4. Verify that the NsccLibrary.jar file appears in the Extra Classpath listbox.

    Click OK to accept this change and dismiss the Preferences dialog box.

Important Note: DrJava only reads the classpath information as it starts up. You will need to exit and restart DrJava for this change to have an effect.

Now, we can test the installation of NsccLibrary into the classpath of DrJava.

  1. Download TestNsccLibrary.java. Open this file in DrJava.
  2. Compile this file. To compile the code in DrJava, you can click the Compile button.

    It should compile with no problems. You should see the message "Compilation completed" in the Compiler Output pane at the bottom of the window.

    If you see error messages instead, you will need to take some corrective actions. Make sure you have restarted DrJava since adding NsccLibrary.jar to the classpath. If you have other issues, you should handle this as soon as possible. You can use the discussion forum as a vehicle to get help. First read the postings there to see if someone else has had a similar issue. Your question may already have an answered posted there. Otherwise ask your question. In general, it is wisest to have only one topic per discussion thread.
  3. To run this code you cannot use the Run button.

    As the tool tip suggests, there needs to be a 'main method' for the Run command. Instead, we will use the Interactions pane. The prompt for the Interactions pane is >. In the Interactions pane, type the following three lines:

    TestNsccLibrary test;
    test = new TestNsccLibrary();
    test.showGreeting();

  4. Here is an example of what the Interactions pane will look like after you have entered these three commands. (We will find out more about what the commands mean and more about the Interactions pane in the notes this week.

    If everything has gone well, you should have a window in the upper left corner of your screen. It may be buried under other windows.

Congratulations!

You should now be ready to develop Java applications for CSC 142.


The optional text book for this course uses BlueJ. You are welcome to use this as an alternate development environment. However, the notes will explain things in terms of the DrJava user interface, rather than BlueJ. You are welcome to ask BlueJ (or DrJava) questions on the discussion forum.

Schedule Page