7181027: [macosx] Unable to use headless mode
Reviewed-by: anthony
This commit is contained in:
parent
5f81b7f30d
commit
9134e38287
@ -170,12 +170,12 @@ public abstract class GraphicsEnvironment {
|
||||
if (System.getProperty("javaplugin.version") != null) {
|
||||
headless = defaultHeadless = Boolean.FALSE;
|
||||
} else {
|
||||
if ("sun.awt.HeadlessGraphicsEnvironment".equals(
|
||||
System.getProperty("java.awt.graphicsenv")))
|
||||
String osName = System.getProperty("os.name");
|
||||
if (osName.contains("OS X") && "sun.awt.HToolkit".equals(
|
||||
System.getProperty("awt.toolkit")))
|
||||
{
|
||||
headless = defaultHeadless = Boolean.TRUE;
|
||||
} else {
|
||||
String osName = System.getProperty("os.name");
|
||||
headless = defaultHeadless =
|
||||
Boolean.valueOf(("Linux".equals(osName) ||
|
||||
"SunOS".equals(osName) ||
|
||||
|
@ -398,6 +398,7 @@ GetJavaProperties(JNIEnv *env)
|
||||
PreferredToolkit prefToolkit = getPreferredToolkit();
|
||||
switch (prefToolkit) {
|
||||
case CToolkit:
|
||||
case HToolkit:
|
||||
sprops.graphics_env = "sun.awt.CGraphicsEnvironment";
|
||||
break;
|
||||
case XToolkit:
|
||||
@ -405,9 +406,6 @@ GetJavaProperties(JNIEnv *env)
|
||||
sprops.graphics_env = "sun.awt.X11GraphicsEnvironment";
|
||||
#ifdef MACOSX
|
||||
break;
|
||||
default:
|
||||
sprops.graphics_env = "sun.java2d.HeadlessGraphicsEnvironment";
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* AWT properties */
|
||||
|
Loading…
x
Reference in New Issue
Block a user