Skip to content

Commit

Permalink
more changes to headless mode; now non-headless mode is used when:
Browse files Browse the repository at this point in the history
- YaCy runs on Windows
- YaCy is started with the -gui option
in all other cases YaCy runs in headless mode

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7481 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Feb 14, 2011
1 parent 6c52e31 commit b35fda4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source/net/yacy/yacy.java
Expand Up @@ -936,12 +936,15 @@ public static void main(String args[]) {
final long startupMemFree = MemoryControl.free();
final long startupMemTotal = MemoryControl.total();

// go into headless awt mode
if (args.length >= 1 && args[0].toLowerCase().equals("-gui")) {
System.setProperty("java.awt.headless", "false");
} else {
System.setProperty("java.awt.headless", "true");
}
// maybe go into headless awt mode: we have three cases depending on OS and one exception:
// windows : better do not go into headless mode
// mac : go into headless mode because an application is shown in gui which may not be wanted
// linux : go into headless mode because this does not need any head operation
// exception : if the -gui option is used then do not go into headless mode since that uses a gui
boolean headless = true;
if (OS.isWindows) headless = false;
if (args.length >= 1 && args[0].toLowerCase().equals("-gui")) headless = false;
System.setProperty("java.awt.headless", headless ? "true" : "false");

String s = ""; for (String a: args) s += a + " ";
yacyRelease.startParameter = s.trim();
Expand Down

0 comments on commit b35fda4

Please sign in to comment.