I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 7cae467b authored by zzz's avatar zzz
Browse files

DTG: Don't try to start if headless (ticket #1924)

parent 2df64cd0
No related branches found
No related tags found
No related merge requests found
...@@ -273,7 +273,7 @@ public class RouterConsoleRunner implements RouterApp { ...@@ -273,7 +273,7 @@ public class RouterConsoleRunner implements RouterApp {
private void startTrayApp() { private void startTrayApp() {
// if no permissions, don't even try // if no permissions, don't even try
// isLaunchedAsService() always returns true on Linux // isLaunchedAsService() always returns true on Linux
if (SystemVersion.isLinuxService() || if (GraphicsEnvironment.isHeadless() || SystemVersion.isLinuxService() ||
(SystemVersion.isWindows() && _context.hasWrapper() && WrapperManager.isLaunchedAsService())) { (SystemVersion.isWindows() && _context.hasWrapper() && WrapperManager.isLaunchedAsService())) {
// required true for jrobin to work // required true for jrobin to work
System.setProperty("java.awt.headless", "true"); System.setProperty("java.awt.headless", "true");
...@@ -285,8 +285,7 @@ public class RouterConsoleRunner implements RouterApp { ...@@ -285,8 +285,7 @@ public class RouterConsoleRunner implements RouterApp {
boolean desktopguiEnabled = Boolean.parseBoolean(sdtg) || boolean desktopguiEnabled = Boolean.parseBoolean(sdtg) ||
(sdtg == null && SystemVersion.isWindows()); (sdtg == null && SystemVersion.isWindows());
if (desktopguiEnabled) { if (desktopguiEnabled) {
//Check if we are in a headless environment, set properties accordingly System.setProperty("java.awt.headless", "false");
System.setProperty("java.awt.headless", Boolean.toString(GraphicsEnvironment.isHeadless()));
net.i2p.desktopgui.Main dtg = new net.i2p.desktopgui.Main(_context, _mgr, null); net.i2p.desktopgui.Main dtg = new net.i2p.desktopgui.Main(_context, _mgr, null);
dtg.startup(); dtg.startup();
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment