Installing the Java Development Kit
1. On your computer, open a terminal window.
2. Type java -version
The output includes a line:Java(™) SE Runtime Environment (build1.X.0_05-b13)
is the version number to look at.
- If this is 7 or greater, you can move on to installing Android Studio.
- If you see a Java SE version is below 7 or if Java is not installed, you need to install the latest version of the Java SE development kit before installing Android Studio.
To download the Java Standard Edition () Development Kit (JDK):
1. Go to the Oracle Java SE downloads page.
2. Click the Java SE Downloads icon to open the Java SE Development Kit 8 Downloads page.
3. In the box for the latest Java SE Development kit, you need to accept the License Agreement in order to proceed. Then download the version appropriate for the computer you are developing on. Important: Do not go to the demos and samples (the menus look very similar, so make sure to read the heading at the top).
4. Install the development kit. Once the installation of the JDK is completed — it should only take a few minutes — you can confirm it’s correct by checking the Java version from the command line.
5. Open a terminal window and enter Type java -version again to verify that installation has been successful.
6. Set the JAVA_HOME environment variable to the installation directory of the JDK.
1. Set JAVA_HOME to the installation location.
2. Start > Control Panel > System > Advanced System Settings > Environment Variables System Variables > New
- Variable name: JAVA_HOME
- Variable value: C:\Program Files\Java\jdk1.7.0_80 (or whatever version your installation is!) 3. If the variable already exists, update it to this version of the JDK.
4. Verify your JAVA_HOME variable from a cmd.exe terminal: echo %JAVA_HOME%
1. Open Terminal.
2. Confirm you have JDK by typing “which java”.
3. Check that you have the needed version of Java, by typing “java -version”.
4. Set JAVA_HOME using this command in Terminal: export JAVA_HOME=`which java`
5. enter echo $JAVA_HOME to confirm the path.
Important: Don’t install Android Studio until after the Java JDK is installed. Without a working copy of Java, the rest of the process will not work. If you can’t get the download to work, look for error messages, and search online to find a solution. Basic Troubleshooting:
- There is no UI, Control Panel, or Startup icon associated with the JDK.
- Verify that you have correctly installed the JDK by going to the directory where you installed it. To identify where the JDK is, , look at your PATH variable and/or search your computer for the “jdk” directory or the “java” or “javac” executable.