JDK-8229800 : WindowsServerCore 1809 does not provide d2d1.dll library required by awt.dll
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9,10,11,13,14
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2019-08-14
  • Updated: 2022-01-05
  • Resolved: 2019-08-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14
11.0.6-oracleFixed 13.0.2Resolved 14 b16Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8230367 :  
JDK-8230368 :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows Server Core 1809 Container on Windows Server 2019 using openJDK 11.3.0+5

A DESCRIPTION OF THE PROBLEM :
Previous versions of the windowsservercore container provided the d2d1.dll as system library, but not version 1809 anymore. Since awt.dll is required even in headless environments for e.g. font handling it is required to provide the d2d1.dll in some other way.





Comments
Microsoft have also fixed this in the 1909 patch update to Windows Server 2019 Go to https://support.microsoft.com/en-us/help/4516077/windows-10-update-kb4516077 The relevant comment is :- Addresses an issue that causes Visio Services in Microsoft SharePoint Online to fail on Windows Server 2019 Core because the required Direct2D component was missing.
07-10-2019

[~clanger] Yes, it would be great to have it pushed to 11u-dev.
07-10-2019

[~akasko] Do you need a sponsor for 11u-dev?
07-10-2019

Fix request: 11u backport requested because it is a part of 11.0.6-oracle. Patch applies cleanly. No regressions, tested with JCK (api/java_awt), checked that AWT can be initialized successfully on headless WindowsServerCore 2019 (version 10.0.17763.437), checked that added code path works as expected (when shcore.dll is absent and d2d1.dll is present).
05-10-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/718496767a7d User: psadhukhan Date: 2019-09-25 09:20:40 +0000
25-09-2019

Removed the tck-red-13 AND tck-red-11.0.5 labels as It’s too late to get this fix tested and integrated into 13 or 11.0.5-oracle so Windows Server Core will not be a supported platform until we are confident in this fix.
29-08-2019

Fix Request This is a request to backport this fix to 13u. The patch from jdk/jdk applies cleanly. The risk is low as it is not changing functionality, just implementing it differently and is critical to support Windows Core Server using JDK in headless server mode. Without this fix many such apps are DOA. The fix can be verified on that platform just by checking that AWT apps load.
28-08-2019

URL: https://hg.openjdk.java.net/jdk/client/rev/718496767a7d User: prr Date: 2019-08-28 16:14:48 +0000
28-08-2019

Reviewed and ready to push in mainstream client repo: http://mail.openjdk.java.net/pipermail/2d-dev/2019-August/010247.html
28-08-2019

The function that has the dependency runtime looks up shcore.dll to get per-monitor information since that dll is only on Windows 8 and above. The compile link time dependency on D2D is there since it is on WIndows Vista SP 2. We no longer support Vista so it is needed just for Windows 7. That will be unsupported after January 2020 but for now it is supported so we can't just break Windows 7. So runtime lookup of this D2D DLL is needed too. It does not apply to 8 since "hidpi" support there is just to allow Windows to auto-scale and it does not have any of this new code which dates from JDK 9.
25-08-2019

[~prr] : I can see the statements #include <d2d1.h> #pragma comment(lib, "d2d1") in below two files: http://hg.openjdk.java.net/jdk/jdk/file/56df9a08ed9c/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp http://hg.openjdk.java.net/jdk/jdk/file/56df9a08ed9c/src/java.desktop/windows/native/common/awt/systemscale/systemScale.cpp
19-08-2019

That's why I don't see anything in the makefile - I think the pragma implicitly creates the dependency. Looks like the depedency came in first in awt_Win32GraphicsDevice.cpp in fixing 8073320: Windows HiDPI Graphics support but later it was moved to systemScale.cpp in fixing 8145173: HiDPI splash screen support on Windows At that time the pragma / include should have been removed from awt_Win32GraphicsDevice That should definitely be done now and then the other thing would have to be to change this to be a runtime dynamic load of the dll and look up of the symbol when required.
19-08-2019

Well, I guess not for anything that uses 2D/AWT.
17-08-2019

[~prr] Regarding supported configuration, See the Notes column, "Includes Windows Server 2019 Core" and "Includes Windows Server 2016 Core".
17-08-2019

I see no evidence that Windows Core Server is a supported configuration https://www.oracle.com/technetwork/java/javase/documentation/jdk11certconfig-5069638.html Also JDK does not link against or use D2D. It uses D3D .. but that is loaded at runtime and if it isn't there no problem. So I don't know where this dependency is coming from. The JDK makefiles don't reference it. This could be a Windows or Visual Studio bug in which case MIcrosoft would need to fix it.
16-08-2019