Quick Eclipse Tutorial

The link to "Other Tutorials" provides a number of in-depth tutorials on Java and Eclipse. Students should go through these (especially the Eclipse tutorials) to become familiar with all the features. This tutorial page provides some nutshell instructions for using Eclipse.

Opening Eclipse

Important - be sure to correctly identify the workspace location.

When invoking Eclipse, be sure to have the workspace properly defined. See the Workspace tutorial for details. This is very important when using a public or lab PC.

To change the workspace location choose file>switch workspace from the menu.

Starting a new project

From the menu: File>new>project>Java project. Press the next button.

A new window opens; enter a project name (the name will be used as a folder name inside the workspace folder).


Press finish.

Closing a project

From the menu: Project>Close project.

Opening an existing project

From the menu: Project>Open project. This assumes the workspace has the project defined.

If the project was created using a different workspace (or the workspace was deleted on a public PC), you can import the project into the current workspace. Choose File>Import>Existing projects into workspace from the menu. In Select root Directory browse to the root folder (the parent folder) of the project. Check the desired project(s) given in the list and press Finish.

Adding a new class file

From the menu: File>new>class. In the New Java Class window, enter a name for the class, and check the "public static void main(..)" box near the bottom if you want the class to include the main method. For most applications, leave the other choices as the defaults.

Accessing a different workspace

At times, you may have an old project in a different location. From the menu: File>Switch Workspace. Be sure to browse to the parent folder of the project folder.

Adding an external java file to an existing project.

Be sure the project is first opened. From the menu: File>Import>File System and press Next. In the popup window, browse to the folder containing the java file(s) you wish to import. Once chosen, the folder name appears in the left panel with a checkbox next to it. If you highlight the folder name, a list of files appears in the right panel. Check the files you wish to import. Press finish. This will add (copy) the files to the default package of your project.

Deleting a project

Close the project but be sure it is highlighted. From the menu: Edit>delete.In the confirmation window you can decide whether to just remove the project from the Package Explorer panel (but not deleting the files) or whether to really delete the files and folder.

Running a project

From the menu choose: Run>Run as>Java Application.

Thank you for visiting the Java Web site - Come back again soon.