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 64-bit JDK, version 8.0_102. If you installed a different version or the 32-bit JDK the main Java directory may be different. Path: Add this path to the beginning or end of Path, separated from the other entries by a semicolon (;) C:\Program Files\Java\jdk1.8.0_102\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. CLASSPATH: Create/set CLASSPATH to this value: .;C:\Program Files\Java\jdk1.8.0_102\lib\tools.jar Environment variable CLASSPATH tells java and javac where to look for standard Java classes (APIs). JAVA_HOME: Create/set JAVA_HOME to this value: C:\Program Files\Java\jdk1.8.0_102 Environment variable JAVA_HOME is used by Android Studio to find Java. 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".) Open a Terminal window and edit your .profile or .bashrc 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" # be sure to enter the quotes; note: /usr/bin alone also works This assumes that you downloaded and installed the 64-bit version of JDK, version 8.0_102 (as above).