JAL-3310 Remove install4j from getdown-launcher.jar. Separate and catch call to...
authorBen Soares <bsoares@dundee.ac.uk>
Mon, 17 Jun 2019 11:08:59 +0000 (12:08 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Mon, 17 Jun 2019 14:11:57 +0000 (15:11 +0100)
getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/jalview/bin/MemorySetting.java
getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java
getdown/src/getdown/launcher/src/main/java/jalview/bin/StartupNotificationListener.java [new file with mode: 0644]
getdown/src/getdown/pom.xml
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index 4a90866..0c41ec2 100644 (file)
Binary files a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar and b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar differ
index aeb6e0c..bf83b3b 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index b3bae2d..8af09da 100644 (file)
@@ -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.
index 5e168ff..799fa96 100644 (file)
@@ -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 (file)
index 0000000..5c6c7c3
--- /dev/null
@@ -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");
+    }
+
+  }
+
+}
index 17cb8f6..e2f1ead 100644 (file)
@@ -65,7 +65,7 @@
                <groupId>com.install4j</groupId>
                <artifactId>install4j-runtime</artifactId>
                <version>7.0.11</version>
-               <!--<scope>provided</scope>-->
+               <scope>provided</scope>
        </dependency>
   </dependencies>
 
index 4a90866..0c41ec2 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 4a90866..0c41ec2 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ