CSCI 136 - Spring 2014

Data Structures & Advanced Programming

Home | Lectures | Handouts | Links | CS@Williams

This page includes instructions for setting up Windows and Mac laptops for use on labs. If you find that these instructions are not accurate, please let your instructor know! I keep this page as up to date as possible, but feedback is always welcome!

Windows

I do not have a Windows laptop, but these instructions have worked in the past. If you have problems with any of these steps, please let me know.

You basically need four "programs" to work on labs on your laptop: java, emacs, bailey.jar, and an SSH program.

JAVA: First, you need to install java, which you can download from here. Follow the installation instructions for java that come with the download. We use version 1.6 in the lab, although newer versions should be ok too.

EMACS: Second, you need to install emacs. The best installation instructions for emacs on Windows can be found here. These directions look scary, but it really isn't too bad. Let me know if you get stuck.

bailey.jar: Third, you need bailey.jar. You can find it here. You will need to add it to your CLASSPATH environment variable. Google for "set CLASSPATH Windows" and you should be able to find your solution for whatever version of Windows you are using. Let me know if you need help with this.

SSH: You will probably need an SSH client so that you will be able to connect to our server. Download and install PuTTY from here. You should use gala.cs.williams.edu as your server, and use your user id and password from the Mac lab. This will allow you to connect to our lab machines remotely.

SCP: If you want to copy files back and forth between the lab machines and your computer, you will need an SCP client. WinSCP is one option. You should use gala.cs.williams.edu as your server (host) name, and use your user id and password from the Mac lab.

Mac OS

If you have a Mac, you probably already have java. Open a terminal and type "java -version" to make sure. You also might have emacs. You can test this by opening a terminal and typing "emacs". If nothing opens, you probably need to install it.

EMACS (Option 1): To install emacs, the best option is to install the version that was specifically written for Mac from here. Note that this will create an application for you in your Applications folder, so you will not be able to just say "emacs" from the terminal. (I can help you with the functionality if you really want it.)

EMACS (Option 2): To install emacs, you first need to install Homebrew. Following the instructions here. After getting Homebrew installed, you should be able to type

          $ brew update
          $ brew install emacs --with-cocoa
          $ brew linkapps emacs

from your terminal. This will automatically install emacs.

EMACS (Option 3): To install emacs, you first need to install Fink. Following the instructions here. After getting Fink installed, you should be able to type "sudo apt-get install emacs22-carbon" from your terminal. This will automatically install emacs.

bailey.jar: You also need bailey.jar. You can find it here. You will need to add it to your CLASSPATH environment variable. This can usually be accomplished by adding the following line to your ".bashrc" file in your home directory (make sure you substitute the full path to bailey.jar where "/path/to/jarfile/" appears:

export CLASSPATH=/path/to/jarfile/bailey.jar:.

You should also add this line to a file called ".bash_profile" in your home directory.

SSH: You will use SSH (usually installed by default) to connect to our server and copy files back and forth. You should use gala.cs.williams.edu as your server, and use your user id and password from the Mac lab. This will allow you to connect to our lab machines remotely.

Copying files

To copy files back to your Mac account, you will use the secure copy utility (scp) from either PuTTY, WinSCP, or your Mac terminal. The syntax is important, so please think before you type. In this example, we will copy file.java from our laptop back to the CS Macs. Note that if there is another file called "file.java" on the Macs, this will override it! Be careful. In this example, abc1 is your CS unix id.

scp file.java abc1@gala.cs.williams.edu:file.java

To copy a file from gala over to your laptop, you can use:

scp abc1@gala.cs.williams.edu:file.java file.java

In general, the first argument is the source, and the second argument is the destination. Whenever you want to specify a remote machine, you must specify your username, hostname, and file name in the format shown. You can close the connection to gala by typing "exit".