temurin-build icon indicating copy to clipboard operation
temurin-build copied to clipboard

Missing msvcp120.dll in bin folder - JDK x64 Windows 8u212-b03

Open flizaga opened this issue 5 years ago • 5 comments

Platform: Windows Server 2012R2

Architecture: OpenJDK8U-jdk_x64_windows_hotspot_8u212b03

In the OpenJDK8U-jdk_x64_windows_hotspot_8u212b03 build, the awt.dll is linked to msvcp120.dll (a DLL from Microsoft Visual C++ 2013 x64). This DLL is located on %ProgramFiles%\AdoptOpenJDK\jdk-8.0.212.03-hotspot\jre\bin. In the default setup AdoptOpenJDK it adds the JDK's bin (%ProgramFiles%\AdoptOpenJDK\jdk-8.0.212.03-hotspot\bin) folder to the PATH env var, but not the jre\bin folder.

So I end up with this error message : java.lang.UnsatisfiedLinkError: C:\Program Files\AdoptOpenJDK\jdk-8.0.212.03-hotspot\jre\bin\awt.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at java.awt.Toolkit$3.run(Toolkit.java:1636) at java.awt.Toolkit$3.run(Toolkit.java:1634) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.loadLibraries(Toolkit.java:1633) at java.awt.Toolkit.(Toolkit.java:1670) at sun.awt.Win32GraphicsEnvironment.(Win32GraphicsEnvironment.java:66) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) at com.hardis.adelia.cloud.tools.AdeliaFontMapping.(AdeliaFontMapping.java:30)

The workaround is to copy %ProgramFiles%\AdoptOpenJDK\jdk-8.0.212.03-hotspot\jre\bin\msvcp120.dll to %ProgramFiles%\AdoptOpenJDK\jdk-8.0.212.03-hotspot\bin

flizaga avatar May 17 '19 08:05 flizaga

P.S. in the 8u202 this DLL isn't required

flizaga avatar May 17 '19 11:05 flizaga

Another workaround is to add jre/bin to the PATH.

alexnb avatar Jul 17 '19 08:07 alexnb

I have the same issue with OpenJDK8U-jdk_x64_windows_hotspot_8u222b10

rtm81 avatar Aug 15 '19 12:08 rtm81

I have the same issue with OpenJDK8U-jdk_x64_windows_hotspot_8u232b09

Matt-Hall avatar Nov 01 '19 16:11 Matt-Hall

I have also noticed this issue crop up with the java dll search path. If you run C:\path\to\java.exe -XshowSettings:properties -version using the java.exe from an install of adoptopenjdk/temurin version 8 (i used 1.8.0_322-b06) the java.library.path setting shows this:

[...]
    java.library.path = C:\Program Files\Eclipse Adoptium\jdk-8.0.322.6-hotspot\bin
        C:\Windows\Sun\Java\bin
        C:\Windows\system32
        C:\Windows
        C:\Windows\system32
        C:\Windows
        C:\Windows\System32\Wbem
        C:\Windows\System32\WindowsPowerShell\v1.0\
        C:\Windows\System32\OpenSSH\
        C:\Users\localtest\AppData\Local\Microsoft\WindowsApps

        .
    java.runtime.name = OpenJDK Runtime Environment
    java.runtime.version = 1.8.0_322-b06
[...]

I think this is closer to the root cause because i believe this java.library.path is higher in the search order when looking for dependent DLL's than PATH (please correct me if this is wrong though). If openJDK were to include the jre/bin folder in this dll search path, i think the issue with not being able to find msvcp120.dll would be solved

MoralCode avatar Feb 17 '22 14:02 MoralCode