CS 210: Data Structures

Kalamazoo College

Fall 2008

Lab: Getting Started with Eclipse



Exercise 1: Creating a Program Using Eclipse

An object-oriented program is, as we learned in class, made up of a collection of classes.  Each class is stored in a separate file, where the name of the file is the name of the class with a .java extension.  Thus, a class called Aquarium must be in the file Aquarium.java.  We might have many classes in a program, and we might have many programs.  How do we keep track of which classes are part of which programs?

The Eclipse development environment uses the idea of a project to keep track of information about a program, such as which classes are part of the program, where the program's starting point is, and so on.  To run or modify a program using Eclipse, the first thing to do is to start up Eclipse and then create a new project or open an existing project to contain and keep track of our classes.

Let's start by creating a very simple program with a single class. To keep things simple, the only method we will create is a main method.


Exercise 2: Importing an Existing Project Using Eclipse

For this part of the lab, you will copy and run an existing project.


Exercise 3: Refactoring and the Edit-Compile-Run Cycle

Now let's return to a project you were working on before, to add new functionality to it.  You will do this frequently in this course, since enhancing an existing program (editing, compiling, and testing existing files) is much more common than creating a completely new one.  In fact, since it is almost impossible to sit down and write a program absolutely correctly from scratch, even new programs are often created by modifying previous programs.


Exercise 4: Creating a New Project from Existing Source + Using JavaDocs

Download and unzip the file WordAnimation.zip to your M: drive.