temurin-build
temurin-build copied to clipboard
Missing msvcp120.dll in bin folder - JDK x64 Windows 8u212-b03
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.
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
P.S. in the 8u202 this DLL isn't required
Another workaround is to add jre/bin to the PATH.
I have the same issue with OpenJDK8U-jdk_x64_windows_hotspot_8u222b10
I have the same issue with OpenJDK8U-jdk_x64_windows_hotspot_8u232b09
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