*/
package jalview.bin;
+import java.awt.GraphicsEnvironment;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
showUsage();
System.exit(0);
}
- // ?>>
+ // BH note: Only -nodisplay is official; others are deprecated?
if (aparser.contains("nodisplay") || aparser.contains("nogui")
- || aparser.contains("headless"))
+ || aparser.contains("headless")
+ || GraphicsEnvironment.isHeadless())
{
- // BH Is this necessary? Seems like a hack; was removed for applet branch
- System.setProperty("java.awt.headless", "true");
+ if (!isJS) {
+ // BH Definitely not a good idea in JavaScript;
+ // probably should not be here for Java, either.
+ System.setProperty("java.awt.headless", "true");
+ }
headless = true;
}
- if ("true".equals(System.getProperty("java.awt.headless")))
+ if (GraphicsEnvironment.isHeadless())
{
headless = true;
}