< prev index next >

src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 167,197 **** if (headless == null) { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { String nm = System.getProperty("java.awt.headless"); if (nm == null) { ! /* No need to ask for DISPLAY when run in a browser */ ! if (System.getProperty("javaplugin.version") != null) { ! headless = defaultHeadless = Boolean.FALSE; ! } else { ! String osName = System.getProperty("os.name"); ! if (osName.contains("OS X") && "sun.awt.HToolkit".equals( ! System.getProperty("awt.toolkit"))) ! { ! headless = defaultHeadless = Boolean.TRUE; ! } else { final String display = System.getenv("DISPLAY"); headless = defaultHeadless = ("Linux".equals(osName) || "SunOS".equals(osName) || "FreeBSD".equals(osName) || "NetBSD".equals(osName) || "OpenBSD".equals(osName) || "AIX".equals(osName)) && (display == null || display.trim().isEmpty()); - } - } } else { headless = Boolean.valueOf(nm); } return null; }); --- 167,186 ---- if (headless == null) { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { String nm = System.getProperty("java.awt.headless"); if (nm == null) { ! final String osName = System.getProperty("os.name"); final String display = System.getenv("DISPLAY"); headless = defaultHeadless = ("Linux".equals(osName) || "SunOS".equals(osName) || "FreeBSD".equals(osName) || "NetBSD".equals(osName) || "OpenBSD".equals(osName) || "AIX".equals(osName)) && (display == null || display.trim().isEmpty()); } else { headless = Boolean.valueOf(nm); } return null; });
< prev index next >