How to Install the Java Software Development Kit

Before you can create and modify Java programs, you'll need the Java Software Development Kit. You can download the kit (also known as Java SDK or JDK) for free from Oracle as a single installer file, which makes installation quick and...
Part 1 of 5:

Downloading the Java Software Development Kit

  1. How to Install the Java Software Development Kit Picture 1How to Install the Java Software Development Kit Picture 1
    Navigate to http://www.oracle.com/technetwork/java/javase/downloads/index.html. You can download a simple Java Software Development Kit (JDK) installer for Windows, macOS, or Linux directly from Oracle.
  2. How to Install the Java Software Development Kit Picture 2How to Install the Java Software Development Kit Picture 2
    Click the Download button beneath 'JDK.' This will open a new page containing several download options.[1]
  3. How to Install the Java Software Development Kit Picture 3How to Install the Java Software Development Kit Picture 3
    Scroll to the latest version of Java SE Development Kit. You should always use the latest stable version of the toolkit. There may be more than one version listed, so look closely at the release number.[2]
    1. For example, if you are presented with JDK 8u101 and 8u102, choose 8u102.
  4. How to Install the Java Software Development Kit Picture 4How to Install the Java Software Development Kit Picture 4
    Click the radio button next to "Accept License Agreement.' Before you can click the download link, you must accept the license agreement. The option is just beneath the JDK version number.
  5. Sign in or register a new account. Before you can download the file, you must sign in an Oracle account. If you already have a account with Oracle, sign in with the email address and username associated with your account. If you do not have account, click Create account and fill out the form to create an account.
  6. How to Install the Java Software Development Kit Picture 5How to Install the Java Software Development Kit Picture 5
    Click the download link for your operating system. You can download Java SE JDK for Windows, macOS, or Linux. Once you click the link, follow the prompts to select a save location on your computer and start the download.
Part 2 of 5:

Installing on Windows

  1. How to Install the Java Software Development Kit Picture 6How to Install the Java Software Development Kit Picture 6
    Double-click the JDK installer file. Once you've downloaded the Java Software Development Kit installer, navigate to the download location you chose earlier to launch the installer. By default, downloaded files can be found in your Downloads folder. You can also open the file from within your web browser.
    1. The file name for the Java Software Development Kit installer is "dk-13.0.2_windows-x64_bin.exe" or "jdk-13.0.2_windows-x64_bin.zip". If you download the ZIP file, you will need to extract the contents of the zip file.
  2. How to Install the Java Software Development Kit Picture 7How to Install the Java Software Development Kit Picture 7
    Allow the app to make changes to your computer. Depending on your version of Windows, you may be prompted to give permission for JDK to install. Click 'Yes' or 'OK' when prompted, and the installer's Welcome screen will appear.[3]
  3. How to Install the Java Software Development Kit Picture 8How to Install the Java Software Development Kit Picture 8
    Click Next to continue. Now you'll move through a series of screens that will guide you through the JDK installation.
  4. How to Install the Java Software Development Kit Picture 9How to Install the Java Software Development Kit Picture 9
    Click Next to accept the default installation settings. This will begin the installation, which may take a few minutes depending on your computer. The green progress bar will show the progress of the installation.[4]
  5. How to Install the Java Software Development Kit Picture 10How to Install the Java Software Development Kit Picture 10
    Click Close when the installation is complete. This button will not appear until the installer has finished.
  6. Open the Windows Advanced System Settings in the Control Panel. Use the following steps to navigate to the Advanced System Settings in the Control Panel:
    1. Click the Windows Start menu and type Control Panel.
    2. Click the Control Panel.
    3. Click System and Security.
    4. Click System.
    5. Click Advanced System Settings in the panel to the left.
  7. How to Install the Java Software Development Kit Picture 11How to Install the Java Software Development Kit Picture 11
    Navigate to the Advanced tab. You'll see a few different areas where you can adjust various system settings.
  8. How to Install the Java Software Development Kit Picture 12How to Install the Java Software Development Kit Picture 12
    Click the Environment Variables button. This new dialog box displays two separate areas—one for User Variables (settings specific to your user account) and another for system-wide settings (System Variables).[5]
  9. How to Install the Java Software Development Kit Picture 13How to Install the Java Software Development Kit Picture 13
    Double-click the Path variable under 'System Variables.' Now you'll add a new variable. Follow these instructions exactly, as there is no 'undo' option.[6]
  10. How to Install the Java Software Development Kit Picture 14How to Install the Java Software Development Kit Picture 14
    Edit the environment variables (Windows 10 only). This step only applies to Windows 10. Use the following steps to edit the environment variables:
    1. Click New
    2. Type c:Program FilesJavajdk1.8.0_xxbin (but replace the '8.0_xx' part with the version number you installed).
    3. Click the Move Up button until the path you typed appears at the top of the list.
    4. Click OK.
  11. How to Install the Java Software Development Kit Picture 15How to Install the Java Software Development Kit Picture 15
    Set the variable (Older versions of Windows only). Skip this step if you're using Windows 10. You should see the 'Edit System Variable' window. Make the following changes to the 'Variable value' field only (don't delete what's there though):
    1. Type C:Program FilesJavajdk1.8.0_xxbin (but replace the '8.0_xx' with the correct version number) in FRONT of the other directories.
    2. Add a semicolon (;) to the very end of what you just typed, just like this: C:Program FilesJavajdk1.8.0_xxbin;
    3. There should be no space before or after the semicolon, so the entire line should look something like this: C:Program FilesJavajdk1.8.0_2bin;C:Program FilesIntelxxx
    4. Click OK.
    5. Click OK until you've closed all open windows.
  12. How to Install the Java Software Development Kit Picture 16How to Install the Java Software Development Kit Picture 16
    Open the Command Prompt
    How to Install the Java Software Development Kit Picture 17How to Install the Java Software Development Kit Picture 17
    . Use the following steps to open the Command Prompt:[7]
    1. Right-click the windows start menu and type cmd.
    2. Click the Command Prompt icon.
  13. How to Install the Java Software Development Kit Picture 18How to Install the Java Software Development Kit Picture 18
    Type path and press Enter. You should see the full path to the JDK that you entered earlier.
  14. How to Install the Java Software Development Kit Picture 19How to Install the Java Software Development Kit Picture 19
    Type java –version and press Enter. The version of JDK you installed will now appear on the screen.
    1. If either part of this command-prompt test does not produce results, you may need to load the new environment variables by rebooting the computer.
Part 3 of 5:

Installing on macOS

  1. How to Install the Java Software Development Kit Picture 20How to Install the Java Software Development Kit Picture 20
    Double-click the installer file you downloaded. After downloading the Java Software Development Kit installer, double-click the downloaded file in the Downloads window of your web browser or in Finder.[8]
  2. Open the downloaded file. You can find downloaded files inside the "Downloads" folder or inside your web browser. The file name should be "jdk-13.0.2_osx-x64_bin.dmg" or something similar.
  3. How to Install the Java Software Development Kit Picture 21How to Install the Java Software Development Kit Picture 21
    Double-click the package icon to start the installer. This icon looks like an open box. The JDK installer will launch.
  4. How to Install the Java Software Development Kit Picture 22How to Install the Java Software Development Kit Picture 22
    Click Continue on the Introduction window. You'll now see the Installation Type window.
    1. If you see a window that says 'Destination Select' after clicking continue, click 'Install for all users of this computer.' Not all users will see this window. Then click Continue. [9]
  5. How to Install the Java Software Development Kit Picture 23How to Install the Java Software Development Kit Picture 23
    Click Install.' You will see a window that says 'Installer is trying to install new software. Type your password to allow this.'
  6. How to Install the Java Software Development Kit Picture 24How to Install the Java Software Development Kit Picture 24
    Sign in as an administrator. Type your administrator username and password into the provided blanks.
  7. How to Install the Java Software Development Kit Picture 25How to Install the Java Software Development Kit Picture 25
    Click 'Install Software.' This may take a few minutes, depending on the speed of your computer. When the confirmation window appears, you can close it.
  8. How to Install the Java Software Development Kit Picture 26How to Install the Java Software Development Kit Picture 26
    Open the 'Applications' folder on your Mac. Now you'll run a quick test from a terminal window to make sure the installation was successful. You can get to this folder by clicking 'Go' and selecting 'Applications.'
  9. How to Install the Java Software Development Kit Picture 27How to Install the Java Software Development Kit Picture 27
    Open the 'Utilities' folder. Here you'll see a list of system utilities.
  10. How to Install the Java Software Development Kit Picture 28How to Install the Java Software Development Kit Picture 28
    Double-click the 'Terminal' app. Now you'll see the command prompt.
  11. How to Install the Java Software Development Kit Picture 29How to Install the Java Software Development Kit Picture 29
    Type javac -version and press Return. Just beneath the command you ran, you should see the JDK version number you installed (e.g. '1.8.0.1'). This means the installation was successful and you can get to your coding.
    1. Once you've made sure the installation is successful, you can delete the DMG installer file you downloaded to conserve hard drive space.
Part 4 of 5:

Installing from an Archive on Linux or Solaris

  1. How to Install the Java Software Development Kit Picture 30How to Install the Java Software Development Kit Picture 30
    Open a terminal window. If you downloaded an archived tarball of the JDK ("jdk-13.0.2_linux-x64_bin.tar.gz" or similar), use this method to complete the installation.
    1. This method assumes you know how to use basic Unix shell commands.
    2. If you downloaded a .rpm package file instead of a tarball, see Installing the JDK from a Package on Linux.
  2. How to Install the Java Software Development Kit Picture 31How to Install the Java Software Development Kit Picture 31
    Navigate to the directory where you'd like to install the JDK. You can install the JDK in any directory for which you have 'write' permissions. Note that only the root user can install the JDK to a system directory.[10]
  3. How to Install the Java Software Development Kit Picture 32How to Install the Java Software Development Kit Picture 32
    Use the mv command to get the archive into the current directory. This allows you to move the file into the current folder.
  4. How to Install the Java Software Development Kit Picture 33How to Install the Java Software Development Kit Picture 33
    Unzip and install the JDK. The command is different depending on your operating system (and in the case of Solaris, the processor type). Once installed, a new directory called "jdk' will be created in the current directory. In these examples, replace the name of the *.tar.gz file with the name of the one you downloaded.[11]
    1. Linux: tar zxvf jdk-7u-linux-i586.tar.gz
    2. Solaris (SPARC): tar xf -
    3. Solaris (x64/EM64T): tar xf -
  5. How to Install the Java Software Development Kit Picture 34How to Install the Java Software Development Kit Picture 34
    Delete the *.tar.gz file. Use the rm command to delete the archive file if you want to conserve disk space.
Part 5 of 5:

Installing from a Package on Linux

  1. How to Install the Java Software Development Kit Picture 35How to Install the Java Software Development Kit Picture 35
    Become root. If you're using an RPM-based Linux system (such as SuSE or RedHat), you can install the Java Development Kit from an RPM package. Make sure you've downloaded the You'll need to su to root (su root) so that you have the correct permission to install the package.[12]
    1. The file you downloaded should end with ".rpm"
    2. This method assumes you know how to use basic Unix shell commands.
  2. How to Install the Java Software Development Kit Picture 36How to Install the Java Software Development Kit Picture 36
    Remove earlier JDK package installations. The command is rpm -e
  3. How to Install the Java Software Development Kit Picture 37How to Install the Java Software Development Kit Picture 37
    Install the new package. You'll be using the "rpm" command again, but this time with different flags:
    1. rpm -ivh jdk-7u-linux-x64.rpm (replace "jdk-7u-linux-x64.rpm" with the actual package name)
  4. How to Install the Java Software Development Kit Picture 38How to Install the Java Software Development Kit Picture 38
    Delete the .rpm file. When the package is finished installing, you'll be returned to the command line. If you want to conserve disk space, you can delete the downloaded package file with the rm command.
5 ★ | 1 Vote