Installing the Android development tools
Oracle JDK and Android SDK are required to build Android mobile apps.
Procedure
- To install Oracle JDK version 8.0, from the Oracle Java™ SE downloads page, download the Java SE Development Kit for your operating system.
- Run the executable file and proceed through the installation program.
- Set the JAVA_HOME environment variable and specify the path to the directory
where the JDK was installed:
Option Description On Windows - Go to your computer's Advanced System Settings.
- On the Advanced tab, click Environment Variables.
- Under System Variables, click New.
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.
- Close all open windows.
- Verify that the JAVA_HOME system environment variable is defined by opening a
new command prompt and running the following command:
A value is returned such as:SET JAVA_HOME
JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_x
On UNIX or Linux - At a command line, run the following command:
vi ~/.bash_profile
- 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
- Save and close the .bash profile, and run the following command to apply
the changes:
source ~/.bash_profile
- Verify that the JAVA_HOME system environment variable is defined by opening a
new command line and running the following command:
echo $JAVA_HOME
- To install the Android SDK, go to the Android developers' website and click to see other download options.
- In the section with the SDK tools, download the SDK for your operating system and extract the compressed file on your computer.
- 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
- 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.