Obtaining and installing Eclipse

A.2 Obtaining and installing Eclipse

A requirement for running the Eclipse IDE is the JRE version 5 or later. For assistance in determining the best JRE for your development computer, go to http:// www.eclipse.org/downloads/moreinfo/jre.php . It is very likely that you already have an acceptable JRE installed on your computer. An easy way to determine what version (if any) you have is to run the following command from a command window or termi- nal session on your development computer:

java -version This procedure checks to see if the JRE is installed and present in your computer’s

search path. If the command comes back with an error stating an invalid or unrecog- nized command, it is likely that the JRE is not installed and/or that it is not properly configured. Figure A.1 demonstrates using this command to check the version of the installed JRE.

Figure A.1 The java –version command displays the version of Java installed on your computer.

Once your JRE is installed, the next step is to install the Eclipse IDE. Download the latest stable release from http://www.eclipse.org/downloads . You will want to download the version for Java developers. This distribution is described at the Eclipse website: http: //www.eclipse.org/downloads/moreinfo/java.php . The Eclipse download is a com- pressed file. Once it is downloaded, extract the contents of the file to a convenient place on your computer. Because this download is simply a compressed file and not an installer, it does not create any icons or shortcuts on your computer.

Obtaining and installing Eclipse

To start Eclipse, run eclipse.exe (for Windows users) found in the Eclipse installa- tion directory. You may want to make your own menu or desktop shortcut to eclipse.exe for convenience. This will start the IDE. Eclipse prompts for a workspace and suggests a default location such as C:\documents and settings\username\work- space. You may want to change that value to something Android specific to separate your Android work from other projects, as shown in figure A.2.

Figure A.2 Eclipse projects are stored in a workspace, which is a directory on your computer’s hard drive.

Accept the suggested workspace location or specify an alternative workspace location, as desired. Once Eclipse is loaded, click the Workbench: Go to the Workbench icon on the main screen, as shown in figure A.3.

Figure A.3 Eclipse defaults to the home screen. Go to the workbench.

A PPENDIX A Installing the Android SDK

Figure A.4 Android development takes place in the Java Perspective.

Eclipse consists of many perspectives, the default being the Java Perspective. It is from this perspective that Android application development takes place. The Java Perspec- tive is shown in figure A.4. Chapter 2 discusses in greater detail the use of the Eclipse IDE for Android application development.

For more information on becoming familiar with the Eclipse environment, visit the http://www.eclipse.org , where you can find online tutorials for building Java applications with Eclipse.

Now that Eclipse is installed, it’s time to focus on the Android SDK.