From 27e3dbd26955b65a203281fdbdba5f462c3f01e2 Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Mon, 15 Feb 2021 21:04:21 +0200 Subject: [PATCH] display Mac users a helpful message about -XstartOnFirstThread requirement if they are trying to run ipscan themselves --- src/net/azib/ipscan/gui/GUI.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/net/azib/ipscan/gui/GUI.java b/src/net/azib/ipscan/gui/GUI.java index a72e7549..c2f46fda 100644 --- a/src/net/azib/ipscan/gui/GUI.java +++ b/src/net/azib/ipscan/gui/GUI.java @@ -32,7 +32,11 @@ public class GUI implements AutoCloseable { } catch (SWTError e) { if (e.getMessage().contains("gtk_init_check")) { - System.err.println(e.toString() + " - probably you are running as `root` and/or don't have access to the X Server. Please run as normal user or with sudo."); + System.err.println(e.toString() + ": probably you are running as `root` and/or don't have access to the X Server. Please run as normal user or with sudo."); + new GoogleAnalytics().report(e); + } + else if (e.getMessage().contains("Invalid thread access")) { + System.err.println(e.toString() + ": you need to start Java with -XstartOnFirstThread on a Mac"); new GoogleAnalytics().report(e); } else throw e;