JDK Installation Tutorial
JDK Installation Tutorial
JDK Installation Tutorial
1.
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.
2)-Click the Download button beneath JDK. This will open a new page
containing several download options.[1]
3.
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]
o For example, if you are presented with JDK 8u101 and 8u102, choose 8u102.
4.
4)-Click 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.
5)-Click the download link next to your operating system. Once you click the link,
follow the prompts to select a save location on your computer and start the download.
6.
6)-Install the JDK on your computer. See Installing on macOS, Installing on Windows,
Installing from an Archive on Linux or Solaris, or Installing from a Package on Linux for
help installing the kit.
Part 2
Installing on macOS
1.
1)-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.[3]
2.
2)-Double-click the package icon to start the installer. This icon looks like an open
box. The JDK installer will launch.
3.
3)-Click Continue on the Introduction window. Now youll see the Installation Type
window.
o 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.[4]
4.
4)-Click Install. You will see a window that says Installer is trying to install new
software. Type your password to allow this.
5.
6)-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.
7.
7)-Open the Applications folder on your Mac. Now youll 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.
8.
8)-Open the Utilities folder. Here youll see a list of system utilities.
9.
9)-Double-click the Terminal app. Now youll see the command prompt.
10.
10)-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.
o Once youve made sure the installation is successful, you can delete the DMG
installer file you downloaded to conserve hard drive space.
Part 3
Installing on Windows
1.
1)-Double-click the JDK installer file. Once youve downloaded the Java Software
Development Kit installer, navigate to the download location you chose earlier to launch
the installer.
2.
2)-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 installers Welcome screen will appear.[5]
3.
3)-Click Next to continue. Now youll move through a series of screens that will
guide you through the JDK installation.
4.
4)-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.[6]
5.
5)-Click Close when the installation is complete. This button will not appear until
the installer has finished.
6.
6)-Press Win + X to launch the Power User menu. Now that the JDK is installed,
youll need to tell Windows how to load it.[7] A menu will appear at the bottom left area
of the screen.
7.
8)-Click the Advanced System Settings link. Now youll see the System Properties
panel.
9.
9)-Navigate to the Advanced tab. Youll see a few different areas where you can
adjust various system settings.
10.
10)-Click the Environment Variables button. This new dialog box displays two
separate areasone for User Variables (settings specific to your user account) and
another for system-wide settings (System Variables).[9]
11.
11)-Double-click the "Path" variable under System Variables. Now youll add a
new variable. Follow these instructions exactly, as there is no undo option.[10]
12.
12)-Click New if youre using Windows 10. This step only applies to Windows 10:
13)-Set the variable in earlier versions of Windows. Skip this step if youre using
Windows 10. You should see the Edit System Variable window. Make the following
changes to the Variable value field only (dont delete whats there though):
14)-Click OK until youve closed all open windows. The installation is complete.
15.
15)-Press Win + R to launch the Run box. Now youll check to make sure the JDK
path is correct.[11]
16.
16)-Type cmd and press Enter . Now youll see a terminal window containing the
command prompt.
17.
17)-Type path and press Enter . You should see the full path to the JDK that you
entered earlier.
18.
18)-Type java version and press Enter . The version of JDK you installed will now
appear on the screen.
o 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 4
1.
1)-Open a terminal window. If you downloaded an archived tarball of the JDK (it ends
with *.tar.gz), use this method to complete the installation.
o This method assumes you know how to use basic Unix shell commands.
o If you downloaded a .rpm package file instead of a tarball, see Installing the JDK
from a Package on Linux.
2.
2)-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.[12]
3.
3)-Move the *.tar.gz file to your current directory. Use the m v command to get the
archive file into the correct directory.
4.
4)-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<version> 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.[13]
5)-Delete the *.tar.gz file. Use the r m command to delete the archive file if you want to
conserve disk space.
Part 5
1.
1)-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 (s u r o o t ) so that you have the correct
permission to install the package.[14]
o rpm -e <package_name>
3.
3)-Install the new package. You'll be using the "rpm" command again, but this time
with different flags:
4)-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 r m command.