Skip to content

Commit

Permalink
windows awt support
Browse files Browse the repository at this point in the history
  • Loading branch information
kkriske committed Dec 24, 2020
1 parent 98228e0 commit 243f7f9
Show file tree
Hide file tree
Showing 7 changed files with 2,125 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected SystemPropertiesSupport() {

initializeProperty(ImageInfo.PROPERTY_IMAGE_CODE_KEY, ImageInfo.PROPERTY_IMAGE_CODE_VALUE_RUNTIME);

if (OS.getCurrent() == OS.LINUX && JavaVersionUtil.JAVA_SPEC == 11) {
if ((OS.getCurrent() == OS.LINUX || OS.getCurrent() == OS.WINDOWS) && JavaVersionUtil.JAVA_SPEC == 11) {
/* AWT system properties are no longer used after JDK 11. */
initializeProperty("awt.toolkit", System.getProperty("awt.toolkit"));
initializeProperty("java.awt.graphicsenv", System.getProperty("java.awt.graphicsenv"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,12 @@ private void prepareImageBuildArgs() {
addImageBuilderJavaArgs("-Djava.awt.printerjob=sun.print.PSPrinterJob");
}

if (OS.getCurrent() == OS.WINDOWS && JavaVersionUtil.JAVA_SPEC >= 11) {
addImageBuilderJavaArgs("-Dawt.toolkit=sun.awt.windows.WToolkit");
addImageBuilderJavaArgs("-Djava.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment");
addImageBuilderJavaArgs("-Djava.awt.printerjob=sun.awt.windows.WPrinterJob");
}

/*
* The presence of CDS and custom system class loaders disables the use of archived
* non-system class and and triggers a warning.
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 243f7f9

Please sign in to comment.