JDK-8199650 : JDK installation uninstalls public JRE
  • Type: Bug
  • Component: install
  • Sub-Component: install
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: other
  • CPU: x86
  • Submitted: 2018-03-14
  • Updated: 2021-04-01
  • Resolved: 2018-04-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u181Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
C:\Program Files\Java\jdk1.8.0_161\bin>java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]

A DESCRIPTION OF THE PROBLEM :
This is on a server running Jenkins CI using 1.8.0_161 x64 JRE.

For some debug information on a hanging java thread I needed jcmd, so downloaded the sibling JDK, got my thread dumps and then continued, only to discover that Jenkins is now unable to start any java process:

[tools] $ cmd.exe /C "c:\jenkins\tools\hudson.tasks.Ant_AntInstallation\Ant\bin\ant.bat -file build.xml -Ddlc=oe11.6 update-json-demo-database && exit %%ERRORLEVEL%%"
'"java.exe"' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Invoke Ant' marked build as failure

Looking at the folders - I found out that my JRE installation had been wiped out - for as far as the JDK installer could. Some files were really really in use and could not be wiped.

The in use files frustate the issue even further since the in use files prevent any repair attempt since the JRE installer refuses to install in a directory that is not empty.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. install JRE
2. install JDK
3. look at JRE folder
4. gasp - the JRE folder has been wiped out


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
4. smile - the JRE folder is still in place

ACTUAL -
4. gasp - the JRE folder has been wiped out

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
CPU18_07-critical-request - Justification : This is critical fix for JDK installer - Risk Analysis : Low. This change is basically a backport of JDK-8181474 plus rework of logic detecting if JRE is installed without functional change. - Review : https://java.se.oracle.com/code/cru/CR-91 - Testing (done/to-be-done) : to be done by SQE - Back ports (done/to-be-done) : none - FX Impact : N/A - Fix For Release : 8u
25-04-2018

This issue is reproducible with JDK 8 as well.
16-03-2018

Post additional information from submitter conveying that he has deselected source and JRE while performing JDK installation steps, confirmed that the public JRE installed in the system C:\Program Files\Java\jre1.8.0_161 is removed by default. Therefore actual steps to reproduce: 1. Install JRE 8u161 (64-bit) C:\Program Files\Java\jre1.8.0_161 2. Install JDK 8u161 (64-bit) Note: Deselect source and JRE or just JRE during install steps. 3. Verfiy the contents in C:\Program Files\Java C:\Program Files\Java\jdk1.8.0_161 (available) C:\Program Files\Java\jre1.8.0_161 (removed) Expected result is that public JRE and JDK should reside side by side in C:\Program Files\Java In submitter's case, removal of public JRE from the system affected the default settings leading to inability to start any Java process with Jenkins. The behavior is consistent with 8u172 ea build.
15-03-2018

JRE 8u161 (64-bit) Windows 8.1 Update 1 Server running Jenkins CI Steps (8u161): Install JRE Install JDK Following steps in the description, the issue does not occur at all. JRE folder including its contents is intact in both places (JRE install as well as JDK install) C:\Program Files\Java\jre1.8.0_161\bin C:\Program Files\Java\jdk1.8.0_161\bin Need to understand if the issue recur frequently and is reproducible in other systems. Also the install logs from affected system would help to evaluate this better. https://www.java.com/en/download/help/log_files.xml Writing back to the submitter requesting above details.
15-03-2018