Introduction to Computer Science II

Project 2 corrections


Goof #1

During lab, I provided incorrect information about your ~/.cshrc file. Below are instructions for editing that file and placing the correct contents within it.

  1. Login to remus/romulus.

  2. Open a terminal window. You should automatically be within your home directory, but to be sure that you are there, type:

    cd ~
  3. Now edit your .cshrc file, like so:

    emacs .cshrc
  4. Find the line that we added in lab to set the value of your CLASSPATH environment variable. Change that line so that it reads:

    setenv CLASSPATH .:/home/staff/sfkaplan/public/cs12
  5. Save the file and exit emacs.

  6. Use the following command in your terminal window just this once to load the new setting for CLASSPATH:

    source .cshrc

What is CLASSPATH? This is a special variable that tells the java command in which directories to look for compiled Java code. We set it to /home/staff/sfkaplan/public/cs12 because that is where the compiled Keyboard code is. However, we also need java to look in the current directory -- the one that contains your compiled code -- for you to be able to run your programs. The period character (.) is how you specify, on the command-line, the current directory. Thus, we have set the CLASSPATH so that java will first look in the current directory for any compiled code that it needs; if it doesn't find what it needs there, then it moves on to /home/staff/sfkaplan/public/cs12 instead. (Note that the colon (:) serves, in that setenv line, as a delimiter between directory names.)


Goof #2

When discussing how to get a sequence of characters from the user, I referred to the Keyboard.readLine() method. There is no such method. However, there is a Keyboard.readString() method that works exactly as I described the fictional Keyboard.readLine(), so use that instead.


Scott F. H. Kaplan
Last modified: Tue Sep 18 09:02:39 EDT 2007