Вы находитесь на странице: 1из 4

Chapter 1

Installation and
Configuration of Your
Development Platform

Installing Eclipse and Java


If you are already developing Java applications, chances are that you are using the
Eclipse integrated development environment (IDE), and of course the Java Development Kit (JDK), and you are using JDK5 or above and most likely the J2SE or Standard Edition. If this is the case, you can skip down to the later section titled
Installing the Android Development Kit. On the other hand, if you are starting
from scratch, Eclipse is available from www.eclipse.org, and the JDK is available
from www.oracle.com/technetwork/java/javase/downloads/index.html. The current
version of the Java Standard Edition is version 7.
In my experience, it is better to download and install the JDK first. There are two
possible downloads: the JDK and the JRE. The JDK is the development software,
and the JRE is simply the run-time environment, a piece of software required by
an operating system to host a Java application. Be sure you download and install
the JDK. It contains and installs a copy of the JRE, so there is no need to install
them separately. You should also note that Eclipse, Java, and Android development
software are available for the Linux and Mac OSs, although they are not directly
addressed here. After the JDK installs, you will want to set its location in your computer systems PATH variable. You can consult references on how to do this on the
Internet, but if you are using Windows 7 as I am, you can use the following steps:
1. Click the Start button. Then right-click on Computer on the right side of the
Start menu and choose Properties. You will see a new window, and the left
side will look like Figure 1.1.
1

Chapter 1 n Installation and Configuration of Your Development Platform

Figure 1.1
Windows 7 System Settings panel.

2. Choose Advanced System Settings on the left. You will see another new window like
Figure 1.2.
3. If it isnt selected already, select the Advanced tab at the top. Then click the
Environment Variables button at the bottom-right. You will see the window
shown in Figure 1.3.
4. In the bottom System Variables area, select Path from the list of variables, and
click the Edit button. At the end of that line, insert a semicolon (;) followed by
the path to your installed JDK, probably a line similar to the following:
c:\program files\java\jdk1.6.0_24\bin\

5. Finally, click OK and work your way out of the windows.


Go ahead and install Eclipse. You can download it at www.eclipse.org. The Eclipse
website offers documentation to help you with the install, but it is pretty straightforward. The Eclipse installation should use the systems path variable to find JDK. If
you havent updated your version of Eclipse lately, be aware that Android development will need versions Europa or newer. At the time of this writing, the current
version is Indigo. Development used in this tutorial was done on Eclipse Galileo.

Installing Eclipse and Java

Figure 1.2
Windows 7 System Properties panel.

Figure 1.3
Windows 7 Environment Variables panel.

Chapter 1 n Installation and Configuration of Your Development Platform

You should note that Eclipse does not install like most Windows software installs. It
comes as a ZIP file that can be placed anywhere on the system and unzipped. I recommend that you create a folder in the Program Files folder on a Windows system
called Eclipse or something equally appropriate and unzip the ZIP file there. You
might also want to create a shortcut for the Eclipse start icon and place it on your
desktop.
When you select the New menu and choose Project, if you can start Eclipse and you
see Java Project as a choice, so far so good. If that doesnt happen for you, go back
and check the documentation for the Eclipse and Java installations. Above all, be
patient.

Installing the Android Development Kit


Finally, you can begin to install the Android Development Kit (ADK). There are
actually two steps to getting Android configured. First, you need the kit; then you
need to configure Eclipse. You can download the ADK at http://developer.android.
com/sdk. Once you have it installed, you need to make a change to your PATH environment variable similar to what you did earlier. You will follow the same steps and
add something like the following to the path: c:\program files (x86)\android\
android-sdk\tools\. Dont forget to separate entries with a semicolon.
To configure the Eclipse plug-in for Android, start Eclipse and select Install New
Software from the Help menu. You will see the screen shown in Figure 1.4.
In the Work With field, enter the following website: http://dl-ssl.google.com/android/
eclipse/. After clicking Add and waiting a moment, a Developer Tools line appears
below. Put a check in the box that appears in the screen below, click Next, and follow
the prompts to the end of the process. You need to agree to all the licenses to get to
the Finish button.
Caution
You must be running Eclipse as an administrator to install plug-ins. For a typical configuration, the steps
in the previous paragraph will fail unless you right-click Eclipse and choose Run as Administrator.
Otherwise, you get an unhelpful error about Missing requirement: Shared Plugin.

Testing the Android installation is similar to testing the Java installation. Again,
select the File menu on Eclipse, select New, Project, and you should see Android
Project as a choice. If it is there, you should be good to go. If not, check your steps
and look for some online troubleshooting help. There is no lack of documentation on
the Internet for Eclipse, Java, and Android. Just use your favorite search engine.

Вам также может понравиться