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

Windows dll loading now resolves symlinks

XMLWordPrintable

    • generic
    • windows

      A DESCRIPTION OF THE PROBLEM :
      In JDK 23, it was possible to build up a Java home directory with symlinks. I.e., make functioning JDK directory where every file in the JDK tree was a symlink to somewhere else. This seems to have regressed on Windows in JDK 24 EA builds. Specifically, the JDK now fails to find critical native libraries on startup.

      I suspect this was a downstream consequence of https://github.com/openjdk/jdk/commit/042053c3a82e9fbd4c6866efe872c1c92714e6e7

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Unpack the JDK 24 download zip file on a Windows machine. The JDK is now in a directory called "jdk-24".
      Do some powershell commands:

      > mv .\jdk-24\bin\jimage.dll rando
      > New-Item -Path .\jdk-24\bin\jimage.dll -ItemType SymbolicLink -Value
      > .\rando

      Attempt to execute javac:

      > .\jdk-24\bin\javac


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      javac prints its help message. This is what happens on JDK 23.
      ACTUAL -
      Error: Unable to load main class com.sun.tools.javac.Main in module jdk.compiler Caused by: java.lang.UnsatisfiedLinkError: .\rando: Can't find dependent libraries

            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: