Choose the operating system for instructions:
Go to the download page for Java and download the installer for your platform. Once the downloader is installed, launch it and follow the prompts to install Java. You can find detailed steps on installing Java for Windows on the Java website page for Windows.
Go to the Oracle website download page for Windows and download the JDK installer. Once the JDK installer is downloaded, launch it and follow the prompts to install the JDK.
Below are the steps to set JAVA_HOME for Windows:
- Open "Edit the system environment variable"
- Click "New" to create new environment variable
- variable name:
JAVA_HOME - variable value:
<jdk_install_path>(example:C:\Program Files\Java\jdk-17.0.2)
- variable name:
- Press "Ok" to save the changes
- re-open the command prompt for the environment variables to apply
- Open "Edit the system environment variable"
- Click "New" to create new environment variable
- variable name:
ANDROID_HOME - variable value:
<android_sdk_path>(example:C:\Users\YourUsername\AppData\Local\Android\Sdk)
- variable name:
- Press "Ok" to save the changes
- Re-open the command prompt for the environment variables to apply
Go to the download page for Java and download the installer for your platform. Once the downloader is installed, launch it and follow the prompts to install Java. You can find detailed steps on installing Java for macOS on the Java website page for macOS.
Go to the Oracle website download page for macOS and download the JDK dmg file following the instructions on the Installing the JDK on macOS section. Once the JDK dmg is downloaded, launch it and follow the prompts to install the JDK.
Below are the steps to set JAVA_HOME for macOS:
export JAVA_HOME=<jdk_install_path>, where <jdk_install_path> must be replaced with the JAVA SDK installation directory (for example, /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home).
Run the following command to set the ANDROID_HOME environment variable:
export ANDROID_HOME=<android_sdk_path>, where <android_sdk_path> must be replaced with the Android SDK installation directory (for example, /Users/YourUsername/Library/Android/sdk).
Go to the download page for Java and download the installer for your platform. Once the downloader is installed, launch it and follow the prompts to install Java. You can find detailed steps on installing Java for Linux on the Java website page for Linux.
Go to the Oracle website download page for Linux and follow the download and install instructions for your Linux operating system.
Below are the steps to set JAVA_HOME for Linux:
export JAVA_HOME=<jdk_install_path>, where <jdk_install_path> must be replaced with the JAVA SDK installation directory (for example, /usr/lib/jvm/jdk-17.jdk).
Run the following command to set the ANDROID_HOME environment variable:
export ANDROID_HOME=<android_sdk_path>, where <android_sdk_path> must be replaced with the Android SDK installation directory (for example, /home/YourUsername/Library/Android/sdk).