JAL-3449 correctly catch absence of install4j in getdown - probably for developers...
[jalview.git] / getdown / src / getdown / core / src / main / java / com / threerings / getdown / data / Application.java
index 944fbde..8d65d28 100644 (file)
@@ -589,6 +589,21 @@ public class Application
        {
                return _initialisedConfig;
        }
+       
+        try {
+          Application.i4jVersion = com.install4j.api.launcher.Variables.getCompilerVariable("sys.install4jVersion");
+        } catch (IOException e)
+        {
+          System.err.println("install4j version not available");
+        } catch (NoClassDefFoundError e)
+        {
+          log.warning("Starting without install4j classes");
+        } catch (Throwable t)
+        {
+          System.err.println("install4j not available");
+          t.printStackTrace();
+        }
+
         Config config = null;
         File cfgfile = _config;
         Config.ParseOpts opts = Config.createOpts(checkPlatform);
@@ -1063,7 +1078,7 @@ public class Application
 
         // add the marker indicating the app is running in getdown
         args.add("-D" + Properties.GETDOWN + "=true");
-        args.add("-Dsys.install4jVersion=" + Variables.getCompilerVariable("sys.install4jVersion"));
+        args.add("-Dsys.install4jVersion=" + Application.i4jVersion);
         args.add("-Dinstaller_template_version=" + System.getProperty("installer_template_version"));
         args.add("-Dlauncher_version=" + Build.version());
 
@@ -2008,4 +2023,6 @@ public class Application
 
     private boolean _initialised = false;
     private Config _initialisedConfig = null;
+    
+    public static String i4jVersion = null;
 }