<- back
Working on Nachos with Eclipse
Eclipse is a very powerful IDE and has a lot of features which
help develop Java applications. This is for the Indigo version.
Setting up Project
- Download and install Java (if needed)
- Download and install Eclipse (if needed)
- Start Eclipse
- File > New > Java Project
- Give it a project name (e.g. "nachos"), under "Project Layout",
choose "Use project folder as root for sources and class files"
- Extract nachos into its own folder (nachos/ with subfolders
nachoes/ag, nachos/machine, .. etc)
- Copy or move this folder into the new folder you created for your
Eclipse workspace.
- Select the "nachos" project from the "Package Explorer" on the
left panel of Eclipse and press "F5" (or right-click on it and select Refresh) to refresh and see the Nachos files.
Compiling and Running
- Eclipse will automatically continuously compile your code
- You will have to copy a required "nachos.conf" file into the root
project folder. The "nachos.conf" you copy will be in the corresponding proj# folder, where # designates the current project number (0, 1, 2, or 3 ).
- The class you want to run is "nachos.machine.Machine", to run
this, find it in the "Package Explorer", right click on it and "Run As
> Java Application".
Tips
- Ctrl+Click-ing on a reference/method/class will take you to it's
delcaration.
- Ctrl+Space is a great hotkey that does a lot of VERY useful
things!
- If you want to pass in command line arguments to a program, you
can right click on it and edit the "Run As > Run Configuration" and
look at the "Arguments" pane.
- You can enable breakpoints and run the program in debug mode from
eclipse by following the above Running instructions but using "Debug
As > ..." instead. For command line arguments, use "Debug As > Debug
Configuration" (see above tip).