CSC 207 Grinnell College Spring, 2012
 
Algorithms and Object-Oriented Design
 

Getting Started with Eclipse

Summary

This reading describes the basic steps required to use Elipse to run a simple Java program.

Introduction

Eclipse organizes software into three basic units:

Class Course.java in package course

The following discussion is based on a class Course.java within a packabe course. Using this example provides a focus for the beginning use of the Eclipse IDE.

Getting Starting

To get started with Eclipse, follow these steps:

  1. Type

       eclipse &
    
    in a terminal window.
  2. The first time you run eclipse, the software will want to identify a base directory for all work with Java. The default is directory workspace within your home directory. Accepting this default seems appropriate for most users.

  3. Create a project by going to FileNewProject. A form will ask you to name the project; "Examples" is one generic name, but you are free to choose any name you wish. The form also allows various options for setting up a project. It is suggested you use the default settings by clicking finish.

  4. Create a package by going to FileNewPackage. As already noted, this reading uses package course, although any valid Java identifier would work. (In the Eclipse form, use the default for the Source folder.) When this step is completed, package course should appear under the source (src) heading within Examples

  5. Create a class by going to FileNewClass. Again use the defaults. When this step is completed, you will see a brief shell for a new Course1 class.

  6. Import a class by going to FileImport. The full path name for the sample Course.java is

      ~walker/public_html/courses/207.sp12/java/course/Course.java
    

    First you will need to identify the directory of the program (click the check box for the directory to proceed). Then you will need to identify the appropriate file (you might want to use the browse option (twice) to find both the relevant directory and the needed file.)

  7. Compile and run by


This document is available on the World Wide Web as

http://www.walker.cs.grinnell.edu/courses/207.sp12/readings/reading-intro-eclipse.shtml

created 17 January 2012
last revised 20 January 2012
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.


Copyright © 2011-2012 Henry M. Walker.
CC-BY-NC-SA
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License .