MCS 178: Introduction to Computer Science II (Spring 2011)

Setting CLASSPATH



Mac OS X

  1. Open Terminal from Applications -> Utilities.
  2. Terminal

  3. Type nano .profile into the Terminal window.
  4. nano .profile

  5. Move the cursor to the end by using the cursor keys.
  6. Add the following:
  7. export CLASSPATH = .:/path/to/introcs
    
    NOTE: Make sure you find out where your introcs directory is and substitute it in the place of /path/to/introcs accordingly.

    Type and Save

  8. Press CTRL-x. When asked to "Save modified buffer", press Y.

  9. Restart the Terminal and you should be all set.

Windows

  1. Right-click on Computer on the desktop and click on Properties.
  2. Click on Advanced system settings.
  3. Go to the Advanced tab and click on Environment Variables.
  4. Click on New... under User variables for (Your Username).

  5. Enter CLASSPATH in Variable name and .;c:\path\to\introcs in Variable value. NOTE: Make sure you find out where your introcs directory is and substitute it in the place of c:\path\to\introcs accordingly.