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

JRE includes fixed old version of Visual C++ redist incompatible with our C++

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 21.0.7
    • hotspot
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10/11/server 2022
      Microsoft visual studio 2022 17.12.4
      Vc redistributable 14.42

      A DESCRIPTION OF THE PROBLEM :
      All JRE21 packages come with microsoft’s Visual C++ redistributable packaged inside the bin directory alongside java.exe. The versions packaged are all our of date:
      Azul JDK21.0.7: 14.40.33810
      Microsoft JDK21.0.7: 14.38.33135
      Amazon Corretto JDK21.0.7: 14.29.30157
       
      The installers have no option to avoid installing these Microsoft DLLs
       
      Due to the presence of these Microsoft DLLs, the most recent Visual C++ runtime which is present in C:\windows\system32 is ignored when running applications under java.
       
      Unfortunately our application uses JNI to call our C++ DLLs. We build these DLLs with Visual studio 2022 17.12.4 which requires the redistributable 14.42 or newer.
       
      We end up with the unfortunate result that our application uses incompatible runtimes which is unsupported by both Microsoft and OpenJDK:
       
      Microsoft have published rules on compatibility between C++ builds and runtimes:
      “When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component.”
       
      openjdk says that we as application developers must be aware of this issue and avoid it: https://bugs.openjdk.org/browse/JDK-8297139?jql=text%20~%20%22visual%20c%2B%2B%20runtime%20library%22
      “your environment is supported only if you follow the Microsoft guidelines when dealing with multiple runtimes”
       
      Requested fix:
      Remove visual C++ runtimes from bin directory and instead install into c:\windows\system32 *if and only if* the required runtimes are newer than what is currently there. This is the Microsoft recommended solution
      Or: Provide documentation explaining to end users how they may override the runtimes provide in the java\bin directory and revert to system runtimes instead
      And: Document to application developers how they may configure their applications when run under java to use a specific newer runtime instead of the packaged java version


            mcadizolivar Mario Cadiz Olivares
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: