Fixed headless issue, added -8.

This commit is contained in:
mathiasdm
2011-02-11 19:12:19 +00:00
parent 1ad005ec6f
commit 4471567344
5 changed files with 56 additions and 14 deletions

View File

@@ -55,19 +55,14 @@ public class Main {
* Main method launching the application.
*/
public static void beginStartup(String[] args) {
boolean wasHeadless = Boolean.valueOf(System.getProperty("java.awt.headless")).booleanValue();
if(wasHeadless) {
System.setProperty("java.awt.headless", "false");
}
boolean headless_check = true;
try {
// X permissions error is a java.lang.InternalError (a Throwable)
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
headless_check = ge.isHeadlessInstance();
} catch (Throwable t) {}
if (wasHeadless)
System.setProperty("java.awt.headless", "true");
if (headless_check) {
String headless = RouterManager.getRouterContext().getProperty("router.isHeadless");
boolean isHeadless = Boolean.parseBoolean(headless);
if(isHeadless) {
return;
}
}
catch(Exception e) {
return;
}
try {