Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8073939

Upgrade from Java 7 to Java 8 does not clear .exe files from /System32

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 8-pool, 9
    • Fix Version/s: 8u60
    • Component/s: install
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      C:\>java -version
      java version "1.8.0_31"
      Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 Enterprise
      Microsoft Windows [Version 6.1.7601]
      64 bit System


      A DESCRIPTION OF THE PROBLEM :
      The steps to recreate this issue is as mentioned below.
      1> Install Java 7 on windows 7 system
      2> Upgrade to Java 8
      3> Open CLI and navigate to the C;/Windows/System32 folder
      4> Run the Java command
      Result : The following error message will appear.
      C:\Windows\System32>java
      Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

      has value '1.8', but '1.7' is required.
      Error: could not find java.dll
      Error: Could not find Java SE Runtime Environment.


      Observation : Made the following observation.
      1> The Java Registry entry has the version as Java 8
      2> The C;/Windows/System32 folder contains the Java.exe which points to Java 7 version.
      3> The folder C;/Program Files/Java folder contains the packages for both Java 7 and 8 jre and Jdk.
      4> The Java Home and Path points to Java 8 Software.


      REGRESSION. Last worked in version 8u31

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      The steps to recreate this issue is as mentioned below.
      1> Install Java 7 on windows 7 system
      2> Upgrade to Java 8
      3> Open CLI and navigate to the C;/Windows/System32 folder
      4> Run the Java command
      Result : The following error message will appear.

      C:\Windows\System32>java
      Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

      has value '1.8', but '1.7' is required.
      Error: could not find java.dll
      Error: Could not find Java SE Runtime Environment.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      c:\Windows\System32>java
      Usage: java [-options] class [args...]
                 (to execute a class)
         or java [-options] -jar jarfile [args...]
                 (to execute a jar file)
      where options include:
          -d32 use a 32-bit data model if available
          -d64 use a 64-bit data model if available
          -server to select the "server" VM
                        The default VM is server.

          -cp <class search path of directories and zip/jar files>
          -classpath <class search path of directories and zip/jar files>
                        A ; separated list of directories, JAR archives,
                        and ZIP archives to search for class files.
          -D<name>=<value>
                        set a system property
          -verbose:[class|gc|jni]
                        enable verbose output
          -version print product version and exit
          -version:<value>
                        require the specified version to run
          -showversion print product version and continue
          -jre-restrict-search | -no-jre-restrict-search
                        include/exclude user private JREs in the version search
          -? -help print this help message
          -X print help on non-standard options
          -ea[:<packagename>...|:<classname>]
          -enableassertions[:<packagename>...|:<classname>]
                        enable assertions with specified granularity
          -da[:<packagename>...|:<classname>]
          -disableassertions[:<packagename>...|:<classname>]
                        disable assertions with specified granularity
          -esa | -enablesystemassertions
                        enable system assertions
          -dsa | -disablesystemassertions
                        disable system assertions
          -agentlib:<libname>[=<options>]
                        load native agent library <libname>, e.g. -agentlib:hprof
                        see also, -agentlib:jdwp=help and -agentlib:hprof=help
          -agentpath:<pathname>[=<options>]
                        load native agent library by full pathname
          -javaagent:<jarpath>[=<options>]
                        load Java programming language agent, see java.lang.instrument

          -splash:<imagepath>
                        show splash screen with specified image
      See http://www.oracle.com/technetwork/java/javase/documentation/index.html for m
      ore details.
      ACTUAL -
      C:\Windows\System32>java
      Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

      has value '1.8', but '1.7' is required.
      Error: could not find java.dll
      Error: Could not find Java SE Runtime Environment.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      C:\Windows\System32>java
      Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

      has value '1.8', but '1.7' is required.
      Error: could not find java.dll
      Error: Could not find Java SE Runtime Environment.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      The workaround for this issue is to uninstall all the previous installation of java software and then install java 8.

        Activity

        Hide
        pardesha Pardeep Sharma added a comment -
        Could reproduce the issue but a system restart cleared the error.

        On a Windows 7 (64-bit) system,
        To recreate the issue, followed steps as explained in the report and could reproduce the issue with 64-bit JRE (remember, the JRE is upgraded from 7u76 to 8u31).
        ---------------------------------------------------------------------------------------------
        Could confirm the observations and output as mentioned in the report (before system restart):
        c:\Windows\System32>java
        Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

        has value '1.8', but '1.7' is required.
        Error: could not find java.dll
        Error: Could not find Java SE Runtime Environment.
        -----------------------------------------------------------------------------------------
        (Post system restart):
        c:\Windows\System32>java
        Usage: java [-options] class [args...]
                   (to execute a class)
           or java [-options] -jar jarfile [args...]
                   (to execute a jar file)
        ------------------------------------------------------------------------------------------------------------
        Followed similar steps for 32-bit JRE (upgrade from JRE 7u76 to 8u31) and it does not show the error.
        Show
        pardesha Pardeep Sharma added a comment - Could reproduce the issue but a system restart cleared the error. On a Windows 7 (64-bit) system, To recreate the issue, followed steps as explained in the report and could reproduce the issue with 64-bit JRE (remember, the JRE is upgraded from 7u76 to 8u31). --------------------------------------------------------------------------------------------- Could confirm the observations and output as mentioned in the report (before system restart): c:\Windows\System32>java Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion' has value '1.8', but '1.7' is required. Error: could not find java.dll Error: Could not find Java SE Runtime Environment. ----------------------------------------------------------------------------------------- (Post system restart): c:\Windows\System32>java Usage: java [-options] class [args...]            (to execute a class)    or java [-options] -jar jarfile [args...]            (to execute a jar file) ------------------------------------------------------------------------------------------------------------ Followed similar steps for 32-bit JRE (upgrade from JRE 7u76 to 8u31) and it does not show the error.
        Hide
        avshastr Avani Shastri (Inactive) added a comment -
        With https://bugs.openjdk.java.net/browse/JDK-7166597, java binaries are no longer copied to system directories. Hence it's expected java exes in system directories will not be updated after jre8uXX install.
        However jre 8uXX does not remove java binaries in system directory if jre 7uXX is present on the system. This is to support the downgrade scenario and enable use to have java in their after jre 8uXX is uninstalled.

        With further investigation, the issue seems to be reproducible only if there are left behind HKLM\Software\JavaSoft\Java Runtime Environment registry keys from previous jre uninstalls. Tried the following scenario with latest promoted 7u76 and 8u60 jres:

        1. Make sure no jre/jdk is installed
        2. Make sure no left left behind registry keys under HKLM\Software\JavaSoft\Java Runtime Environment
        3. Install jre 7u76
        4. Run "java" at command line; expected java usage options shown
        5. Install jre 8u60
        6. 4. Run "java" at command line; confirmed expected java usage options shown

        Confirmed this on both Cygwin terminal and Windows command prompt.

        Suggested workaround to avoid the described issue: Clean the registries before installing jre 7 and jre 8.

        Show
        avshastr Avani Shastri (Inactive) added a comment - With https://bugs.openjdk.java.net/browse/JDK-7166597, java binaries are no longer copied to system directories. Hence it's expected java exes in system directories will not be updated after jre8uXX install. However jre 8uXX does not remove java binaries in system directory if jre 7uXX is present on the system. This is to support the downgrade scenario and enable use to have java in their after jre 8uXX is uninstalled. With further investigation, the issue seems to be reproducible only if there are left behind HKLM\Software\JavaSoft\Java Runtime Environment registry keys from previous jre uninstalls. Tried the following scenario with latest promoted 7u76 and 8u60 jres: 1. Make sure no jre/jdk is installed 2. Make sure no left left behind registry keys under HKLM\Software\JavaSoft\Java Runtime Environment 3. Install jre 7u76 4. Run "java" at command line; expected java usage options shown 5. Install jre 8u60 6. 4. Run "java" at command line; confirmed expected java usage options shown Confirmed this on both Cygwin terminal and Windows command prompt. Suggested workaround to avoid the described issue: Clean the registries before installing jre 7 and jre 8.

          People

          • Assignee:
            avshastr Avani Shastri (Inactive)
            Reporter:
            webbuggrp Webbug Group
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: