Skip to main content.

Eclipse Guide for CS162

You can use any IDE for Nachos. Thomas recommends Eclipse. Here are some tips that have been collected; please send any tips you have.

A visual walkthrough for setting up Eclipse (with screengrabs) is available at the Fall 2006 course site.


Nachos has a directory/package structure that Eclipse doesn't like very much, so you have to be careful when creating the project so that Eclipse can find each package. (Otherwise it might see "threads" instead of "nachos.threads".) You should create the project in the parent directory of your Nachos source tree, i.e. the directory containing the directory "nachos".

One way to do this is:


Nachos unfortunately has a function named assert, which became a Java keyword in Java 1.4. Eclipse by default will use Java 1.4 compatibility which disallows it as a function name. To tell Eclipse to allow "assert" as not-a-keyword: Open preferences → compiler compliance & class files; change all the compatibility options from 1.4 to 1.3, and change "assert as keyword" to "ignore".


The Subversion plugin for Eclipse is Subclipse.

To install from Eclipse: Help → Software Updates → Find and Install → Search for new features and Install

To add a new repository: Window → Open Perspective → Other → SVN Repository Browser. Right click on blank spot in browser and choose New → Repository Location.

To export your current project in your PC onto the repository, just switch perspectives back to "Java" perspective (clock on Java near top right corner of eclipse window), right click on your nachos project and choose: Team → Share Project.

Detailed Eclipse + Subclipse setup instructions (OS-X biased)

You should have already emailed your TA requesting a Subversion group repository and should have received your group repository name. If not, do that now.

First, one group member should create a folder in your repository for your project.

  1. Login to your class account, e.g. cs162-aa
  2. Checkout your group repository
        svn co
  3. Add a folder for your project
        cd group1
        mkdir homework1
        svn add homework1
        svn commit homework1

The following should be done for each Eclipse installation:

  1. Download Eclipse 3.2 from
  2. Start Eclipse
  3. Install Subclipse (Subversion plugin for Eclipse) following instructions at
  4. File > New > Project
  5. Select "Checkout Projects from SVN" and press "Next"
  6. Select "Create a new repository location" and press "Next"
  7. Enter your repository URL, e.g.
  8. Press "Accept Permanently" if you're asked to accept a certificate
  9. Your username is your class account, e.g. cs162-aa
  10. Your password is the password to your class account.
  11. Choose whether to save the password, and press "Next"
  12. Select the previously created folder and press "Next"
  13. Select "Check out as a project in the workspace" and press "Next"
  14. Press "Finish"

Background color on instructional Sun machines

To change the background color go to preferences → window → java editor → background color.


The main class to run is nachos.machine.Machine.