From: Ben Soares Date: Mon, 17 Jun 2019 11:08:59 +0000 (+0100) Subject: JAL-3310 Remove install4j from getdown-launcher.jar. Separate and catch call to... X-Git-Tag: Release_2_11_0~6^2^2~7 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=a44bf47650800c7fcb0a6d493e1c52e13f4e4e76 JAL-3310 Remove install4j from getdown-launcher.jar. Separate and catch call to install4j's StartupNotification.Listener. --- diff --git a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar index 4a90866..0c41ec2 100644 Binary files a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar and b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index aeb6e0c..bf83b3b 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/core/src/main/java/jalview/bin/MemorySetting.java b/getdown/src/getdown/core/src/main/java/jalview/bin/MemorySetting.java index b3bae2d..8af09da 100644 --- a/getdown/src/getdown/core/src/main/java/jalview/bin/MemorySetting.java +++ b/getdown/src/getdown/core/src/main/java/jalview/bin/MemorySetting.java @@ -24,7 +24,7 @@ public class MemorySetting } catch (NoClassDefFoundError e) { // com.sun.management.OperatingSystemMXBean doesn't exist in this JVM - System.out.println("No com.sun.management.OperatingSystemMXBean"); + System.err.println("No com.sun.management.OperatingSystemMXBean"); } // We didn't get a com.sun.management.OperatingSystemMXBean. diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index 5e168ff..799fa96 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -27,7 +27,6 @@ import javax.swing.JFrame; import javax.swing.KeyStroke; import javax.swing.WindowConstants; -import com.install4j.api.launcher.StartupNotification; import com.samskivert.swing.util.SwingUtil; import com.threerings.getdown.data.Application; import com.threerings.getdown.data.EnvConfig; @@ -35,6 +34,7 @@ import com.threerings.getdown.data.SysProps; import com.threerings.getdown.util.LaunchUtil; import com.threerings.getdown.util.StringUtil; import static com.threerings.getdown.Log.log; +import jalview.bin.StartupNotificationListener; /** * The main application entry point for Getdown. @@ -94,18 +94,16 @@ public class GetdownApp try { - StartupNotification.registerStartupListener( - new StartupNotification.Listener() { - @Override - public void startupPerformed(String parameters) - { - log.warning("StartupNotification.Listener.startupPerformed: '"+parameters+"'"); - setStartupFilesParameterString(parameters); - } - }); + jalview.bin.StartupNotificationListener.setListener(); } catch (Exception e) { e.printStackTrace(); + } catch (NoClassDefFoundError e) + { + log.warning("Starting without install4j classes"); + } catch (Throwable t) + { + t.printStackTrace(); } // record a few things for posterity diff --git a/getdown/src/getdown/launcher/src/main/java/jalview/bin/StartupNotificationListener.java b/getdown/src/getdown/launcher/src/main/java/jalview/bin/StartupNotificationListener.java new file mode 100644 index 0000000..5c6c7c3 --- /dev/null +++ b/getdown/src/getdown/launcher/src/main/java/jalview/bin/StartupNotificationListener.java @@ -0,0 +1,29 @@ +package jalview.bin; + +import com.threerings.getdown.launcher.GetdownApp; +import static com.threerings.getdown.Log.log; + +public class StartupNotificationListener { + + public static void setListener() { + + + try { + com.install4j.api.launcher.StartupNotification.registerStartupListener( + new com.install4j.api.launcher.StartupNotification.Listener() { + @Override + public void startupPerformed(String parameters) { + log.info("StartupNotification.Listener.startupPerformed: '"+parameters+"'"); + GetdownApp.setStartupFilesParameterString(parameters); + } + } + ); + } catch (Exception e) { + e.printStackTrace(); + } catch (NoClassDefFoundError t) { + log.warning("Starting without install4j classes"); + } + + } + +} diff --git a/getdown/src/getdown/pom.xml b/getdown/src/getdown/pom.xml index 17cb8f6..e2f1ead 100644 --- a/getdown/src/getdown/pom.xml +++ b/getdown/src/getdown/pom.xml @@ -65,7 +65,7 @@ com.install4j install4j-runtime 7.0.11 - + provided diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index 4a90866..0c41ec2 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index 4a90866..0c41ec2 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ