To get through all the CS303 lab assignments, you don't need to understand a lot of Eclipse. Basically, what you do for each programming assignment is to
The details are illustrated below. (Assignment 1 is used as the sample, but the procedures can be generally applied to all assignments with appropriate change on the assignment number.) You can click on the icon to see the original high-resolution image.
| Step | Comments | Illustration |
|---|---|---|
| Build a project | Download and unzip the skeleton code. This will create a folder named a1 with a sub-folder src in it, which contains the skeleton code. |
|
Go to start - All Programs - Eclipse - eclipse.exe to open Eclipse. In the Workspace Launcher, accept the default setting and click OK. |
||
If Eclipse is run for the first time, a welcome page will be displayed. Click the Workbench symbol. |
||
In the workbench, go to File - New - Project ... to start a new project. |
||
In the New Project window, select JAVA Project and click Next. |
||
In the New JAVA Project window, type in the project name a1 and click Finish. A JAVA project is created! |
||
| Import skeleton code | In the Package Explorer, right click on a1 and select Import .... |
|
In Import window, expand General and select File System. |
||
Click Browse ..., and locate src in the Import from directory window (Desktop/a1/src). |
||
In Import window, click Select All and then Finish. The skeleton code is imported! |
||
| Expand and save the code | In Package Explorer window, expand a1 - (default package) to see all the files included in the skeleton code. Double-click to view the content of the file in the main window. The places where you need to expand/edit are marked as TODO. Implement all the TODOs and then save the project by pressing Ctrl+S. Eclipse will generate the class files under the workbench directory. Your program is now ready to run! |
|
| Run your program | To run your JAVA program, go back to the desktop, and go to start - Run .... |
|
In the Run window, type in cmd and then click OK. |
||
Change to the project directory in cmd. In the default setting, this would be C:\Documents and Settings\[BlazerID or u144]\workspace\a1. It also can be tracked in Eclipse by going to Project - Properties - Info - Location. Once in the project directory, type java A1 to run the program. |