1. How to set Windows Path, CLASSPATH, and JAVA_HOME environment variables for the JAVA Development Kit (JDK) Right-click on Computer and select Properties, then click on Advanced system settings on the left. A window should open showing various tabs, including System Properties; click on Environment Variables on the lower right of that window. A new window will open showing User and System variables. You can also get to that Environment Variables window by typing "system environment" (without the quotes) in the Windows search box and selecting the link that is displayed. The Path variable should already exist in the System variables section of Environment Variables; you will probably have to create the other two in the User or System variables section. In each case below, if the variable exists just double-click on it or highlight it and click Edit; if it does not exist, click New and then type in the variable's name and appropriate value. Note: These changes/settings assume that you downloaded and installed the latest 64-bit JDK, version 10. If you installed a different version or the 32-bit JDK the main Java directory may be different. Path for Windows 8.1 or earlier: Path: Add this path to the beginning or end of Path, separated from the other entries by a semicolon (;) C:\Program Files\Java\jdk-10.0.2\bin If you put this at the start, follow it with a semicolon; if at the end, precede it with one. Environment variable Path tells Windows where to find the java and javac commands. Path for Windows 10 or later: Path: Add this path to the beginning or end of the set of paths in the current Path variable: C:\Program Files\Java\jdk-10.0.2\bin CLASSPATH: Create or set CLASSPATH to this value (just a single period character): . Environment variable CLASSPATH tells java and javac where to look for standard Java classes (APIs). JAVA_HOME: Create or set JAVA_HOME to this value: C:\Program Files\Android\Android Studio\jre Environment variable JAVA_HOME is used by Android Studio to find the java command. This is important because Android Studio will not work with version 10 of Java - the version that Android Studio uses as its default SDK is guaranteed to work OK for JAVA_HOME. 2. How to set the OS X PATH environment variable for the JAVA Development Kit (JDK) (This will probably also work for Linux, although the path to Java may be different. To find the path to Java after it's installed, open a Terminal or Console window and type "which java".) Note: on a Mac, if you install JDK version 10 (as above) you probably will not have to set PATH - open a Terminal window and type "java -version" and "javac -version" without the quotes - if those work and tell you the current version (10) then you can skip setting the PATH environment variable. If those do not show 10 as the version, or if java or javac are not found as commands, do this: Open a Terminal window and edit your .bash_profile file to contain the following line, then save that file and restart the shell (close and reopen the Terminal window). After that you should be able to type "java -version" and "javac -version", without the quotes, and get a valid output (no error message): export PATH="$PATH:/usr/bin/java" # this is the line to add to .bash_profile - be sure to enter the quotes Here are specific instructions for how to add that line to your .bash_profile: 1. Open a Terminal window by typing Terminal into Spotlight and pressing enter 2. In that Terminal window enter the following command exactly as written and press enter: echo 'export PATH="$PATH:/usr/bin/java"' >> ~/.bash_profile 3. If that works then close the Terminal window and reopen it, then type echo $PATH - the resulting output should now show /usr/bin/java at the end of the printout 4. If step 2 or step 3 fails, try typing this into the Terminal window and press enter: sudo chown ~/.bash_profile 5. If you had to do step 4, go back and try steps 2 and 3 again. If they still fail, see me! This assumes that you downloaded and installed the 64-bit version of JDK, current version 10 (as above). You will also need to set JAVA_HOME to point to the standard SDK that Android uses; on a Mac, add this line to your .bash_profile file, save that file, and close and reopen the Terminal window: export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home" Here are specific instructions for how to add that line to your .bash_profile: 1. Open a Terminal window by typing Terminal into Spotlight and pressing enter 2. In that Terminal window enter the following command exactly as written and press enter: echo 'export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"' >> ~/.bash_profile 3. If that works then close the Terminal window and reopen it, then type echo $JAVA_HOME - the resulting output should now show /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home 4. If step 2 or step 3 fails, try typing this into the Terminal window and press enter: sudo chown ~/.bash_profile 5. If you had to do step 4, go back and try steps 2 and 3 again. If they still fail, see me! Note that you will have to exit Android Studio and restart it once you have added the JAVA_HOME line! This is important because Android Studio will not work with version 10 of Java - the version that Android Studio uses as its default SDK is guaranteed to work OK for JAVA_HOME.