Installing the Android development tools

Oracle JDK and Android SDK are required to build Android mobile apps.

Procedure

  1. To install Oracle JDK version 8.0, from the Oracle Java™ SE downloads page, download the Java SE Development Kit for your operating system.
  2. Run the executable file and proceed through the installation program.
  3. Set the JAVA_HOME environment variable and specify the path to the directory where the JDK was installed:
    Option Description
    On Windows
    1. Go to your computer's Advanced System Settings.
    2. On the Advanced tab, click Environment Variables.
    3. Under System Variables, click New.
    4. Specify JAVA_HOME as the variable name and enter the path to the JDK installation directory as the variable value.

      Environment variable values cannot be separated by a space. If the Java installation directory contains a space in the path name, specify the shortened path name. For example, on Windows operating systems, enter a path such as C:\Progra~1\Java\jdk1.8.0_x.

    5. Close all open windows.
    6. Verify that the JAVA_HOME system environment variable is defined by opening a new command prompt and running the following command:
      SET JAVA_HOME
      A value is returned such as:
      JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_x
    On UNIX or Linux
    1. At a command line, run the following command:
      vi ~/.bash_profile
    2. Set the variables by running the following command and replacing the java_path variable with the Java path that you specified:
      export JAVA_HOME=java_path
      export PATH=$JAVA_HOME/bin:$PATH
    3. Save and close the .bash profile, and run the following command to apply the changes:
      source ~/.bash_profile
    4. Verify that the JAVA_HOME system environment variable is defined by opening a new command line and running the following command:
      echo $JAVA_HOME
  4. To install the Android SDK, go to the Android developers' website and click to see other download options.
  5. In the section with the SDK tools, download the SDK for your operating system and extract the compressed file on your computer.
  6. Start the installation wizard.
    Option Description
    On Windows From the extracted directory, run the SDK Manager.exe file.
    On UNIX or Linux Open a terminal and navigate to the android_home/tools/ directory, then run the following command:
    android sdk
  7. Under Tools, select Android SDK Tools Revision 22 or later and the latest Android SDK build tools. Also, select an Android package with an API of 14 or greater and click Install Packages.