Java Programming using the
Eclipse/JDT IDE
Overview
“Eclipse is an open source software development project dedicated to providing a robust, full-featured, commercial-quality, industry platform for the development of highly integrated tools.” (From the Eclipse FAQ.) It is a software platform for supporting integrated development environments (IDEs). The Java Development Toolkit (JDT) is a full-featured IDE for Java development built on the Eclipse platform. The Eclipse platform was built as an open source project and is widely used in the software industry. It is available for free download from the Eclipse web site (www.eclipse.org). Software toolkits that have been designed and developed to run on the Eclipse platform are called “plug-ins”. The JDT is an example of a plug-in. Numerous additional plug-ins are available. Most of them have been developed as open-source projects.
Getting and Installing Eclipse
The latest version of Eclipse is available for free as a download from www.eclipse.org. The JDT is packaged as part of the download. (In the rest of this description the term Eclipse is used to mean the Eclipse/JDT IDE.) Eclipse comes as a zip file. You must have a Java Runtime Environment (JRE) installed on your computer. Eclipse requires version 1.3 or 1.4 of a Java 2 Standard Edition JRE. The Eclipse SDK does not ship with a JRE. If you have not yet done so go to java.sun.com and download Java 2 Standard Edition version 1.3 (J2SE v1.3) or later.
The most recent builds of Eclipse (2.0 and later) are designed to run on Windows XP, Windows 2000, Windows 98, Windows ME, Red Hat Linux Version 7.1, SuSE Linux 7.1, and Solaris 8.
When you first run Eclipse you will need to open a Java Perspective by going to the Window menu, selecting Open Perspective, then selecting Java. The environment should appear as follows.

Creating, Editing, and Running Java Programs in Eclipse
To develop Java programs in the Eclipse environment you need to create a project. From the File menu select New then Project … Follow the wizard to create a Java Project giving it a name.
Once you have a project you can create a class by selecting New then Class from the File menu. The New Java Class wizard allows you to specify the name of the class as well as additional features including whether or not you want a stub for a main method in the class.

The class will be placed in a package named (default package). The Eclipse environment will appear as follows

The Java Perspective has four subwindows. The Package Explorer window provides a view of the file structure of the project. There is an editor window in the center. The Outline window displays the structure of the class. The subwindow at the bottom is the Tasks window. The Tasks window is replaced by a Console window during execution.
To execute the program you first need to create a run configuration. To create a run configuration for the DemoMain class select Run … from the Run menu. Select Java Application and then the New button. Fill in the Name: and Main class: fields (DemoMain for both here). Finally click the Run button.
Once the run configuration has been created the program can be run by selecting the name of the run configuration from Run History in the Run menu.
When the program is run any console input/output appears in the console at the bottom of the Eclipse environment.

Additional source files (.java files) can be added to the project in several ways. Perhaps the easiest way is to locate the source file using say Windows Explorer, copy the file, then highlight the Demo folder in the Package Explorer window and select Paste from the Edit menu. Alternatively you can highlight the Demo folder in the Package Explorer window and select Import … from the File menu. This will initiate the Import wizard. Select File System then browse your file system for the file(s) to be imported.
As with most Java IDE’s you can have a number of projects. Each project will be represented by a folder in the Package Explorer window. Each project folder in the Package Explorer window is a folder (of the same name) on your file system. The collection of project folders are located in <Eclipse-install>\Eclipse\workspace, where <Eclipse-install> is the path for the folder where you extracted the Eclipse zip file. So yet another way to add source files to a project is to copy the source files into the corresponding project folder in <Eclipse-install>\Eclipse\workspace. If you use this technique you will not see the source files in the Package Explorer until you select Refresh from the File menu.