1.2. Installing and Running Eclipse

Problem

You want to install Eclipse and get it running on your machine.

Solution

After you’ve downloaded it, installing Eclipse is not hard: unzip or untar the Eclipse download, and you’re ready to go. Because you’ve downloaded the version of Eclipse targeted to your operating system, you’ll find the executable file as soon as you uncompress Eclipse. To run Eclipse, just run that executable file.

Discussion

One of the great things about Eclipse is the ease with which you can install it. Wherever you unzip or untar it is its home. You also can have parallel installations of Eclipse; just decompress it in the various directories you want and run the executable file, such as eclipse.exe.

Users of big, invasive IDEs will appreciate the fact that Eclipse installs quickly, does not require multiple reboots, and does not include hidden spyware. Windows developers will be relieved to learn that Eclipse does not install itself in the Windows registry, with all the attendant problems that can cause. So, (re)installation is painless.

When you first run Eclipse, you’ll see the Resource perspective by default, as shown in Figure 1-2. As discussed in the Recipe 1.6 later in this chapter, a perspective presents an arrangement of windows to the user. If you open a particular perspective over and over, you’ll always get the same set of windows. The Resource perspective is a general perspective that is good for resource management, particularly file handling. But we’re not going to work with it here because everything we need, including virtually all functionality that the Resource perspective offers, is in the Java-oriented perspectives, particularly the Java perspective, discussed later in this chapter.

Tip

The Resource perspective doesn’t have to be your default perspective. Select Window Preferences Workbench Perspectives to choose a default perspective. Java programmers often select the Java perspective here, which is the main perspective for Java development.

The Resource perspective

Figure 1-2. The Resource perspective

Tip

You must have Java installed on your machine to start Eclipse. If you start Eclipse for the first time and see a dialog box with a message beginning with the sentence “A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse,” download and install Java first. You can get Java for free at http://java.sun.com/j2se/.

After installing Eclipse, you can make it easier to run by connecting a shortcut to it. In Linux or Unix, add the Eclipse directory to your path, or use ln -s to create a symbolic link to the Eclipse executable. In Windows, right-click the executable file in Windows Explorer and select Create Shortcut from the context menu that opens, then drag the new shortcut where you want it.

See Also

Recipe 1.6 on perspectives, views, and editors; Recipe 1.3 on understanding the Eclipse workspace; Chapter 1 of Eclipse (O’Reilly).

Get Eclipse Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.