forked from I2P_Developers/i2p.i2p
DTG: Don't try to start if headless (ticket #1924)
This commit is contained in:
@ -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 {
|
|||||||
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 {
|
||||||
|
Reference in New Issue
Block a user