Changeset f97402b
- Timestamp:
- Feb 11, 2011 7:13:47 PM (10 years ago)
- Branches:
- master
- Children:
- 1d1472c
- Parents:
- dd2c506 (diff), 4471567 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/desktopgui/src/net/i2p/desktopgui/Main.java
rdd2c506 rf97402b 56 56 */ 57 57 public static void beginStartup(String[] args) { 58 boolean wasHeadless = Boolean.valueOf(System.getProperty("java.awt.headless")).booleanValue(); 59 if(wasHeadless) { 60 System.setProperty("java.awt.headless", "false"); 58 try { 59 String headless = RouterManager.getRouterContext().getProperty("router.isHeadless"); 60 boolean isHeadless = Boolean.parseBoolean(headless); 61 if(isHeadless) { 62 return; 63 } 61 64 } 62 boolean headless_check = true; 63 try { 64 // X permissions error is a java.lang.InternalError (a Throwable) 65 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); 66 headless_check = ge.isHeadlessInstance(); 67 } catch (Throwable t) {} 68 if (wasHeadless) 69 System.setProperty("java.awt.headless", "true"); 70 if (headless_check) { 65 catch(Exception e) { 71 66 return; 72 67 } -
apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java
rdd2c506 rf97402b 2 2 3 3 import java.util.ArrayList; 4 import java.awt.GraphicsEnvironment; 4 5 import java.io.File; 5 6 import java.io.FilenameFilter; … … 55 56 private static final String USAGE = "Bad RouterConsoleRunner arguments, check clientApp.0.args in your clients.config file! " + 56 57 "Usage: [[port host[,host]] [-s sslPort [host[,host]]] [webAppsDir]]"; 58 private static final String PROP_HEADLESS = "router.isHeadless"; 57 59 58 60 static { 59 61 System.setProperty("org.mortbay.http.Version.paranoid", "true"); 60 System.setProperty("java.awt.headless", "true"); 62 63 //Check if we are in a headless environment, set properties accordingly 64 List<RouterContext> contexts = RouterContext.listContexts(); 65 if(contexts != null && contexts.size() > 0) { 66 RouterContext context = contexts.get(0); 67 String headless = context.getProperty(PROP_HEADLESS); 68 if(headless == null) { 69 /* 70 * Let's check if we are in a headless environment. 71 * We do this by setting headless to false 72 * and trying to get the graphics environment. 73 * If this fails, we should be headless. 74 */ 75 System.setProperty("java.awt.headless", "false"); 76 try { 77 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); 78 ge.isHeadlessInstance(); 79 context.setProperty(PROP_HEADLESS, "false"); 80 } 81 catch(InternalError e) { 82 context.setProperty(PROP_HEADLESS, "true"); 83 } 84 context.router().setConfigSetting(PROP_HEADLESS, context.getProperty(PROP_HEADLESS)); 85 context.router().saveConfig(); 86 context.router().shutdown(0); 87 } 88 boolean isHeadless = true; 89 try { 90 isHeadless = Boolean.parseBoolean(headless); 91 } 92 catch(Exception e) { 93 //Incorrect setting, let's choose headless for safety 94 isHeadless = true; 95 } 96 if(isHeadless) { 97 System.setProperty("java.awt.headless", "true"); 98 } 99 else { 100 System.setProperty("java.awt.headless", "false"); 101 } 102 } 61 103 } 62 104 -
build.xml
rdd2c506 rf97402b 98 98 99 99 <target name="buildDesktopGui" depends="buildCore, buildrouter" > 100 <ant dir="apps/desktopgui" target="clean" /> 100 101 <ant dir="apps/desktopgui" target="jar" /> 101 102 </target> -
history.txt
rdd2c506 rf97402b 1 2011-02-11 Mathiasdm 2 * routerconsole: fixed graphs using jrobin; and headless issue 3 in general: no more switches between headless and non-headless. 4 1 5 2011-02-11 sponge 2 6 * I2PTunnel: fix NPE in I2PTunnelConnectClient
Note: See TracChangeset
for help on using the changeset viewer.