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:
- Create a new empty directory (e.g. cs162)
- Unpack nachos in this directory, so that you have cs162/nachos
- In Eclipse, "Create project at external location" and enter the parent directory of nachos (in this example, cs162).
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.
- Login to your class account, e.g. cs162-aa
- Checkout your group repository
svn co https://void.eecs.berkeley.edu/cs162/group1
- 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:
- Download Eclipse 3.2 from eclipse.org
- Start Eclipse
- Install Subclipse (Subversion plugin for Eclipse) following instructions at http://subclipse.tigris.org/install.html
- File > New > Project
- Select "Checkout Projects from SVN" and press "Next"
- Select "Create a new repository location" and press "Next"
- Enter your repository URL, e.g. https://void.eecs.berkeley.edu/cs162/group1
- Press "Accept Permanently" if you're asked to accept a certificate
- Your username is your class account, e.g. cs162-aa
- Your password is the password to your class account.
- Choose whether to save the password, and press "Next"
- Select the previously created folder and press "Next"
- Select "Check out as a project in the workspace" and press "Next"
- 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.