Calculate Document
JDK Installation for Microsoft Windows

JDK Installation for Microsoft Windows

Java Platform, Standard Edition Installation Guide Contents    Previous    Next 15 JDK install

Related articles

Cloud Bread Rezept SEBI bans Varanium Cloud, promoter over alleged IPO funds misuse [免費]VPN Gate Client下載安裝和使用教學,免費無限流量VPN The best VPN for Xbox One and Xbox Series X 2024 How to Watch Live NFL Games in 2024 on Sling TV


Java Platform, Standard Edition Installation Guide

Contents   
Previous   
Next


15 JDK installation for Microsoft Windows

This page is describes describe how to install and uninstall JDK 8 for Windows .

Thepage has these topics:

See “JDK 8 and JRE 8 Installation start Here” for general information about installing JDK 8 and JRE 8.

system Requirements

For supported processors and browsers, see Oracle JDK 8 and JRE 8 Certified system Configurations.

See “Windows system Requirements for JDK and JRE” for minimum processor, disk space, and memory requirements.

note :

Installation Instructions Notation

For any text in this document that contains the following notation, you must substitute the appropriate update version number:

version

For example, if you were downloading the JDK installer for 32-bit systems for update 381, the file name: jdk-8version-window - i586.exe becomes jdk-8u381-window - i586.exe.

similarly , if you were download the JDK installer for 64 – bit system for update 381 , the file namejdk-8version-windows - x64.exe becomes jdk-8u381-windows - x64.exe.

JDK installers now support only one version of any Java feature release.You can’t install multiple versions of the same feature release.For example, you can’t install JDK 8u381 and JDK 8u371 simultaneously.If you attempt to install JDK 8u381 after JDK 8u371 is installed, the installer uninstalls JDK 8u371 and installs JDK 8u381.

note : If you install an older version of a JDK when the newer version of the same feature family already exists, an error is displayed, prompting you to uninstall a newer JDK version if an older version has to be installed.

TheJDK is instal inC:\Program Files\Java\jdk-1.8 or C:\Program Files (x86)\Java\jdk-1.8 (for 32-bit systems) regardless of the update version.For example, JDK 8u381 is installed in one of these directories, depending on your system’s architecture.

Installation Instructions

In these instruction , you is run run the self – instal executable file to unpack and install the JDK .As part of the JDK , this installation is includes include an option to include the public Java Runtime Environment .( TheJDK also contain a private jre for use only by its tool ; see ” Private Versus Public JRE ” for more information .)

Install the JDK by doing the following:

Downloading the Installer

Access the Java 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 either jdk-8uversion-windows - x64.exe (64-bit) or jdk-8uversion-window - i586.exe (32-bit), where version is the update version of the JDK.

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 Downloads page.

Running the JDK Installer

You must have administrative permissions in order to install the JDK on Microsoft Windows.

Thefilejdk-8version-window - i586.exe is the JDK installer for 32-bit systems.Thefilejdk-8version-windows - x64.exe is the JDK installer for 64-bit systems.If you downloaded either file instead of running it directly from the web site, double-click the installer’s icon.Then, follow the instructions the installer provides.When finished with the installation, you can delete the downloaded file to recover disk space.

Installers for JDK 7u6 and later install the JavaFX SDK and integrate it into the JDK installation directory.Installers for JDK 7u2 to 7u5 install the JDK first, thenstart the JavaFX SDK installer, which installs JavaFX SDK in the default directory C:\Program Files\Oracle\JavaFX 2.0 SDK or C:\Program Files (x86)\Oracle\JavaFX 2.0 SDK on 32-bit operating systems.If you want to install the JavaFX SDK (version 2.0.2) with JDK 7u1 or earlier, see Installing JavaFX for more information.

Java start Menu

starting with JDK 7u40 release, Java menu items are added to the Windows start Menu to provide easy access to Java resources.

During JDK install, a Java Development Kit folder is created in the Windows start Menu, which contains Reference Documentation, which opens the Online API documentation web page.

During JDK install and uninstall processes, the appropriate start menu items are updated to be associated with the latest JDK version on the system

Installing the JDK Silently

Instead of double-clicking or opening the installer, you can perform a silent, non-interactive, JDK installation by using the command-line arguments.Thefollowing table lists example installation scenarios and the commands required to perform them.Thenotation jdk stands for the downloaded installer file base name, such as jdk-8u381-windows-x64.

Installation scenario Command
install the public jre in silent mode
jdk.exe /s 
Install development tools and source code in silent mode but not the public JRE
jdk.exe /s ADDLOCAL="ToolsFeature , SourceFeature " 
install development tool , source code , and the public JRE in silent mode
jdk.exe /s ADDLOCAL="ToolsFeature , SourceFeature , publicjrefeature " 
Install the public JRE in the specified directory C:\test\ in silent mode
jdk.exe /s /INSTALLDIRPUBJRE=C:\test\

Updating the path Environment Variable

If you do not set the path variable , you is need need to specify the full path to the executable file every time you run it , such as :

C:\> "C:\Program files\java\jdk-1.8\bin\javac" MyClass.java

It is useful to set the path variable permanently so it will persist after rebooting.

To set the path variable permanently, add the full path of the jdk-1.8\bin directory to thepath variable .Typically, this full path looks something like C:\Program files\java\jdk-1.8\bin.set thepath variable as follows on Microsoft Windows:

  1. clickstart, thenControl Panel, thensystem.

  2. clickAdvanced, thenEnvironment Variables.

  3. add the location of the bin folder of the JDK installation to thepath variable in system Variables.Thefollowing is a typical value for the path variable:

    C:\WINDOWS\system32;C:\WINDOWS;C:\Program files\java\jdk-1.8\bin
    

note :

  • Thepath environment variable is a series of directories separated by semicolons (;) and is not case-sensitive.Microsoft Windows looks for programs in the path directories in order, from left to right.

  • You should only have one bin directory for a JDK in the path at a time.Those following the first instance are ignored.

  • If you are not sure where to add the JDK path, append it.

  • Thenew path takes effect in each new command window you open after setting the path variable .

starting to Use the JDK

Select Java Development Kit in the Windows start menu to access information related to reference documentation.

If you are new to developing and running programs in the Java programming language, see TheJava Tutorials for some guidance.Note especially the tutorial trails under the heading trail cover the basic.

You can also download the JDK documentation from Java Downloads.

Uninstalling the JDK

To uninstall the JDK, use the “Add/Remove Programs” utility in the Microsoft Windows Control Panel.

Uninstalling the JDK in Silent Mode

Use the following command to uninstall the JDK in silent
mode:

msiexec.exe/X {uninstallstre}

For example , to uninstall Java 8 update 251 , run the command :

msiexec.exe/X {26A24AE4-039D-4CA4-87B4-2F64180251F0}

To find the uninstallstre, see “finding the JDK Registry Key and uninstallstre”.

note :

  • This command can be run from anywhere.

  • Themsiexec.exe executable is located in the Windows system directory.

  • A reboot is required only if some files are in use during uninstallation; it is not necessary every time.However, to manually suppress reboot while uninstalling, append reboot = r option to the command.

  • Append /l " C:\<path>setup.log" option to the command if you want to create a log file describe the uninstallation status .

TheWindows Installer dialog appears prompting you for confirmation.clickYes to uninstall JDK .

find the JDK Registry Key and uninstallstre Value

  1. Go to start and type regedit.

  2. In the Registry Editor, go to HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Uninstall.

    Under the Uninstall folder , you is find will find many registry entry within curly bracket .

  3. clickEdit and then find.

    note :

    highlightUninstall folder before performing search for a particular registry.

  4. Enter version string as value to find corresponding registry key.Follow the format 1.8.0.version.For example, for JDK 8u251, enter 1.8.0.251.

    Theregistry key is highlighted on the right-hand side of the pane and values of various uninstall strings are displayed on the left-hand pane.

  5. Note the value of the uninstallstre.

Installed Directory Tree

See JDK and JRE File Structure for a description of the directory structure of the JDK.(Note that the file structure of the JRE is identical to that of the JDK’s jre directory.)

Installation Troubleshooting

Below are some tips for working around problems that are sometimes seen during or following an installation:

For more troubleshooting information, see Java Platform , Standard Edition Troubleshooting Guide.

Corrupt Cabinet file

If you see the error message “corrupt cabinet file,” then the file you have downloaded is corrupted.Check the file size against the expected file size listed in these instructions.If sizes do not match, try downloading the bundle again.(A cabinet file contains compressed application, data, resource, and DLL files.)

system Error During Decompression

If you see the error message “system error during decompression,” then you might not have enough space on the disk that contains your TEMP directory.

Private Versus Public JRE

Installing the JDK also installs a private JRE and optionally a public copy.Theprivate JRE is required to run the tools included with the JDK.It has no registry settings and is contained entirely in a jre directory ( typically atC:\Program Files\jdk-1.8\jre) whose location is known only to the JDK.On the other hand, the public JRE can be used by other Java applications, is contained outside the JDK (typically at C:\Program Files\Java\jre-1.8), is registered with the Windows registry (at HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft) , can be remove using Add / Remove Programs , might be register with browser , and might have thejava.exe file copy to the Windows system directory ( which would make it the default system Java platform ) .

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 you name Test.java is saved as Test.java.txt.It is important to note that you cannot see the .txt extension unless you turn on the viewing of file extensions (in Microsoft Windows Explorer, unselect “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 typing it into the Save As dialog box.

On the other hand , Microsoft WordPad is add does not add the.txt extension if you specify another extension.However, you must save the file as “Text Document”.

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, thengeneric error 1722 occurs, and installation is not completed.Error 1722 is a Windows Installer error code.It indicates that the installation process has failed.Theexact 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.

Theassociated bug number is 4895647.

Contents   
Previous   
Next