Using Eclipse To Run Java
Using Eclipse To Run Java
1. Visit www.eclipse.org.
2. On that Web site, follow the links for downloading Eclipse. Be sure
to pick the version thats appropriate for your operating system
(Linux, Macintosh, Windows, or whatever).
The download is a compressed file a ZIP file, a tar.gz file, or
something like that.
The next step depends on which operating system you have.
3. If youre not using a Macintosh, Extract the compressed files
contents to a directory on your hard drive. If youre using a Mac,
dont bother extracting. Just look for a new Eclipse icon on your
desktop.
On my Windows computer, I extract the compressed files contents to
the root of my C: drive. On my Linux/Unix computer, I extract the
compressed files contents to my /usr/local directory. In either case,
the extraction creates a new directory named eclipse. The eclipse
directory contains everything I need in order to run Eclipse.
Running Eclipse
Heres how you start an Eclipse session:
Figure 1: Opening the Java perspective for the very first time.
3. In the Project Name field, type a name for your new project.
In Figure 3, I typed Chapter03_Listing01. In the steps that follow, I
assume that you also type Chapter03_Listing01. Of course, you can
type all kinds of things in the Project Name field. Im an old stick in the
mud so I avoid putting blank spaces in my project names. But if you
insist, you can use dashes, blank spaces, and other troublesome
characters.
You have to type a name for your new project. Aside from typing a
name, you can accept the defaults (the Location and Project Layout stuff)
in the New Java Project wizard.
4. Click Finish.
When you click Finish, the Eclipse workbench reappears. The leftmost
area contains the Package Explorer view. The views list contains your
new Chapter03_Listing01. (See Figure 4.)