5 Installation of the JDK on Microsoft Windows Platforms
This topic includes the following sections:
System Requirements for Installing the JDK on 64-Bit Windows Platform
For supported processors and browsers, see Oracle JDK Certified Systems Configurations.
JDK Installation Instruction Notation for Windows
For any text in this document that contains the following notation, you must substitute the appropriate update version number:
interim.update.patch
For example, if you are downloading the JDK installer for 64-bit systems for update 12 Interim 0, Update 0, and Patch 0, then the file name jdk-12.interim.update.patch_windows-x64_bin.exe becomes jdk-12_windows-x64_bin.exe.
JDK Installation Instructions for Windows
You run a self-installing executable file to unpack and install the JDK on Windows computers.
Install JDK on Windows computers by performing the actions described in the following topics:
Downloading the JDK Installer
Access Java SE Downloads page and click Accept License Agreement. Under the Download menu, click the Download link that corresponds to the .exe for your version of Windows.
Download the file jdk-12.interim.update.patch_windows-x64_bin.exe.
Note:
Verify the successful completion of file download by comparing the file size on the download page and your local drive. Alternatively, you can ensure that the downloaded file's checksum matches the one provided on the Java SE Downloads page.Running the JDK Installer
- Start the JDK 12 installer by double-clicking the installer's icon or file name in the download location.
- Follow the instructions provided by the Installation wizard.
- After the installation is complete, delete the downloaded file to recover the disk space.
Installing the JDK Silently
Instead of double-clicking or opening the JDK installer, you can perform a silent, non interactive, JDK installation by using command-line arguments.
The following table lists example installation scenarios and the commands required to perform them. The notation jdk stands for the downloaded installer file base name, such as jdk-12_windows-x64_bin.exe.
| Installation Scenario | Command |
|---|---|
| Install JDK in silent mode. | |
| Install development tools and source code in silent mode. | |
Setting the PATH Environment Variable
It is useful to set the PATH variable permanently for JDK 12 so that it is persistent after rebooting.
If you do not set the PATH variable, then you must specify the full path to the executable file every time that you run it. For example:
C:\> "C:\Program Files\Java\jdk-12\bin\javac" MyClass.javaPATH variable permanently, add the full path of the jdk-12\bin directory to the PATH variable. Typically, the full path is:C:\Program Files\Java\jdk-12\binPATH variable on Microsoft Windows:
Beginning to Use the JDK
Use the Java Development Kit in the Windows Start menu to access information related to Reference Documentation.
During JDK install, Java menu items are added to the Windows Start menu to provide easy access to Reference Documentation, which is online documentation web page.
During JDK installation and uninstallation processes, the appropriate start menu items are updated so that they are associated with the latest JDK version on the system
Note:
The Windows 7 and Windows 10 have a Start menu; however, the menu is not available in Windows 8 and Windows 8.1. The JDK and Java information in Windows 8 and Windows 8.1 is available in the following Start directory:%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs.
Uninstalling the JDK on Windows
JDK Installation Troubleshooting
The following sections provide tips for resolving issues, if any, while installing JDK.
System Error During Decompression
If you see the error message: system error during decompression, then there might not be enough space on the disk that contains the TEMP directory.
Program Cannot Be Run in DOS Mode
If you see the error message: This program cannot be run in DOS mode, then do the following:
-
Open the MS-DOS shell or command prompt window.
-
Right-click the title bar.
-
Select Properties.
-
Select the Program tab.
-
Click Advanced.
-
Ensure that the item Prevent MS-DOS-based programs from detecting Windows is not selected.
-
Select OK.
-
Select OK again.
-
Exit the MS-DOS shell.
-
Restart your computer.
Source Files in Notepad
In Microsoft Windows, when you create a new file in Microsoft Notepad and then save it for the first time, Notepad usually adds the .txt extension to the file name. Therefore, a file that you name Test.java is actually saved as Test.java.txt. Note that you cannot see the .txt extension unless you turn on the viewing of file extensions (in Microsoft Windows Explorer, deselect Hide file extensions for known file types under Folder Options). To prevent the .txt extension, enclose the file name in quotation marks, such as "Test.java" when entering information in the Save As dialog box.
Characters That Are Not Part of the System Code Page
It is possible to name directories using characters that are not part of the system locale's code page. If such a directory is part of the installation path, then generic error 1722 occurs, and installation is not completed. Error 1722 is a Windows installer error code. It indicates that the installation process has failed. The exact reason for this error is not known at this time.
To prevent this problem, ensure that the user and system locales are identical, and that the installation path contains only characters that are part of the system locale's code page. User and system locales can be set in the Regional Options or Regional Settings control panel.
The associated bug number is 4895647.