Before you can create and modify Java programs, you will need the Java Software Development Kit or Java software development tools. This toolkit (known as the Java SDK or JDK) can be downloaded for free from the Oracle site as a single installation file so that the installation process can be followed quickly and easily. Learn the best way to download and install Java software development tools on a Windows, MacOS, or Linux computer.
Step
Part 1 of 5: Downloading the Java Software Development Kit
Step 1. Visit
You can download a simple Java Software Development Kit (JDK) installation file for Windows, MacOS, or Linux operating systems directly from the Oracle site.
Step 2. Click the Download button under the words “JDK”
A new page will open and contain several download options.
Step 3. Scroll the page to the latest Java SE Development Kit version segment
Make sure you always run the equipment with the latest stable version. The page you open may show more than one version so make sure you pay attention to the version release number.
For example, if you see “JDK 8u101” and “8u102” options, select “8u102” option
Step 4. Click the radio button next to “Accept License Agreement”
Before the download link can be clicked, you need to agree to the license agreement. This option is below the JDK version number.
Step 5. Sign in or create a new account
Before the installation file can be downloaded, you must be logged in to your Oracle account. If you already have an account, sign in using the email address and username associated with the account. If not, click Create account ” and fill in the account creation form.
Step 6. Click the download link according to the computer operating system
You can download the Java SE JDK for Windows, MacOS, or Linux computers. Once the link is clicked, follow the on-screen prompts to select a location for the download to be saved on your computer and start downloading the file.
Part 2 of 5: Installing the Java SE Development Kit on a Windows Computer
Step 1. Double-click the JDK installation file
Once the Java Software Development Kit installation file has finished downloading, go to the download directory that was previously selected to run the file. By default, you can find downloaded files in the “Downloads” folder. You can also open the installation file directly from a web browser.
The Java Software Development Kit installation file name is " dk-13.0.2_windows-x64_bin.exe " or " jdk-13.0.2_windows-x64_bin.zip ". If you're downloading a ZIP file, you'll need to extract the contents first
Step 2. Allow the application to make changes to the computer
You may be asked to give permission to install the JDK, depending on the version of Windows you are running. Click “Yes” or “OK” when prompted. After that, the JDK installation welcome page will be displayed.
Step 3. Click Next to continue
You need to go through a series of pages that will guide you through the JDK installation process.
Step 4. Click Next to accept the default installation settings
The JDK installation process will begin and may take about a few minutes, depending on the computer. A blue progress bar will be displayed to show the progress of the installation.
Step 5. Click Close once the installation is complete
This button will not be displayed until the installation is complete.
Step 6. Open the “Windows Advanced System Settings” section of the Control Panel
Follow these steps to access “Advanced System Settings” in Control Panel:
- Click the Windows “Start” menu and type in Control Panel.
- Click "Control Panel".
- Choose " System and Security ”.
- Click " System ”.
- Click " Advanced System Settings ” in the panel on the left.
Step 7. Go to the Advanced tab
You can see several segments to adjust various system settings.
Step 8. Click the Environment Variables button
The new dialog box will show two different segments, one for “User Variables” (settings specific to your user account) and one for more general system settings (“System Variables”).
Step 9. Double click the Path variable under “System Variables”
Now, you can add a new variable. Follow these instructions exactly as you don't have the option to undo the action.
Step 10. Edit environment variables (for Windows 10 only)
This step only applies to Windows 10 users. Follow these steps to edit environment variables:
- Click " New ”.
- Type in c:\Program Files\Java\jdk1.8.0_xx\bin (replace “8.0_xx” with the version number of the JDK you installed).
- Click the button " Move Up ” until the address you typed is at the top of the list.
- Click " OK ”.
Step 11. Set the variable (for older versions of Windows only)
Skip this step if you are using Windows 10. You should see the “Edit System Variable” window. Make the following changes to the " Variable value " column only. However, don't delete existing entries or variables:
- Type C:\Program Files\Java\jdk1.8.0_xx\bin (replace the “8.0_xx” section with the appropriate version number) BEFORE any other directory.
- Insert a semicolon (;) at the end of the typed entry (eg C:\Program Files\Java\jdk1.8.0_xx\bin;).
- Make sure there are no spaces before and after the semicolon. Overall, the entry line should look like this: C:\Program Files\Java\jdk1.8.0_2\bin;C:\Program Files\Intel\xxx
- Click " OK ”.
- Click " OK ” until all open windows are closed.
Step 12. Open Command Prompt
Follow these steps to open Command Prompt:
- Right-click the Windows “Start” menu and type cmd.
- Click the “Command Prompt” icon.
Step 13. Type in the path and press Enter
You can see the full address of the JDK that was previously entered.
Step 14. Type java –version and press Enter
The installed JDK version will be displayed on the screen.
If these two tests performed on the Command Prompt return no results, you may need to load new environment variables by restarting the computer
Part 3 of 5: Installing the Java SE Development Kit on MacOS
Step 1. Double-click the downloaded installation file
Once the Java Software Development Kit installation file has finished downloading, double-click the file in the “Downloads” window in your browser or Finder.
Step 2. Open the downloaded file
You can find the file in the " Downloads " folder or in your browser. This file is named " jdk-13.0.2_osx-x64_bin.dmg " (or something similar).
Step 3. Double click the package icon to run the installation
This icon looks like an open box. The JDK installation window will run.
Step 4. Click Continue on the opening window
You will see the “Installation Type” window after that.
If you see a window with the message “Destination Select” after clicking the “Continue” button, select “Install for all users of this computer”. Not all users can see the window. After that, click " Continue ”.
Step 5. Click Install
You will see a window with the message “Installer is trying to install new software. Type your password to allow this”.
Step 6. Log on to the computer as administrator
Type the username and password for the administrator account in the fields provided.
Step 7. Click “Install Software”
The installation process may take a few minutes, depending on the speed of the computer. Once the confirmation window is displayed, you can close it.
Step 8. Open the “Applications” folder on the computer
You will need to run a quick test via Terminal to make sure the program installs successfully. Access the Terminal program storage folder by clicking the “Go” menu and selecting “Applications”.
Step 9. Open the “Utilities” folder
In this folder, you can see a list of system utilities.
Step 10. Double click the “Terminal” app
After that, you will see a command line window.
Step 11. Type javac -version and press Return key
Under the run command, you can see the version number of the installed JDK (eg “1.8.0.1”). This means that the program has been installed successfully and you can code.
Once the program is confirmed to have installed successfully, you can delete the previously downloaded DMG installation file to save space on your hard drive
Part 4 of 5: Installing the Java SE Development Kit from Archive on a Linux or Solaris Computer
Step 1. Open a Terminal window
If you have already downloaded the JDK tarball archive file (eg " jdk-13.0.2_linux-x64_bin.tar.gz " or a similar file), complete the installation by following this method.
- For this method, it's assumed that you understand how to use basic Unix shell commands.
- If you downloaded the.rpm package file, and not the tarball archive file, read the method for installing the JDK from the package on a Linux computer.
Step 2. Go to the directory where you want to install the JDK
You can mount the JDK in any directory, as long as you have write permissions. Keep in mind that only the root user can mount the JDK into the system directory.
Step 3. Use the mv command to move the archive file to the currently opened directory
With this command, you can move files to the current directory.
Step 4. Extract the archive file and install the JDK
The commands used will depend on the operating system (and for Solaris, the processor type). Once installed, a new directory named “jdk” will be created in the main directory currently accessed. For this example, rename the *.tar.gz file with the name of the file you downloaded.
- Linux: tar zxvf jdk-7u-linux-i586.tar.gz
- Solaris (SPARC): gzip -dc jdk-8uversion-solaris-sparcv9.tar.gz
- Solaris (x64/EM64T): gzip -dc jdk-8uversion-solaris-x64.tar.gz
Step 5. Delete the *.tar.gz file
Use the rm command to delete archive files if you want to save storage space.
Part 5 of 5: Installing the Java SE Development Kit from Package Files on a Linux Computer
Step 1. Log in or use the root user
If you are using an RPM-based Linux operating system (eg SuSE or RedHat), you can install the Java Development Kit from the RPM package. Make sure you download the appropriate file. You will also need to use the command “su to root” (su root) to get the proper permissions to install program packages.
- Make sure the downloaded file has a ".rpm" extension
- For this method, it's assumed that you understand how to use basic Unix shell commands.
Step 2. Uninstall old JDK packages
The command that needs to be run is rpm -e
Step 3. Install the new JDK package
You need to reuse the “rpm” command, but this time with a different variable or flag:
rpm -ivh jdk-7u-linux-x64.rpm (replace "jdk-7u-linux-x64.rpm" with the package name to use)
Step 4. Delete the.rpm file
Once the package has finished installing, you will be taken back to the command line window. If you want to save space on your computer, delete the downloaded package file with the rm command.