X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FLauncher.java;h=041a7b1a8573b0bdb72ba5a8231ad88901d726fc;hb=fb97a6a7e2f0c39910f283d858b185514521f1b5;hp=412f119221d4a19e936a0ea32f9af84f0e12dfe5;hpb=74f21ca6ca8fa17d53708e457d191e15904f8310;p=jalview.git diff --git a/src/jalview/bin/Launcher.java b/src/jalview/bin/Launcher.java index 412f119..041a7b1 100644 --- a/src/jalview/bin/Launcher.java +++ b/src/jalview/bin/Launcher.java @@ -7,13 +7,8 @@ import java.util.ArrayList; public class Launcher { - private final static String startClass = "jalview.bin.Jalview"; - private final static int maxHeapSizePerCent = 90; - - private final static String maxHeapSizePerCentProperty = "jvmmempc"; - private final static String dockIconPath = "JalviewLogo_Huge.png"; public static void main(String[] args) @@ -65,41 +60,8 @@ public class Launcher if (!memSet) { - long maxMemLong = -1; - int percent = maxHeapSizePerCent; - String jvmmempc = System.getProperty(maxHeapSizePerCentProperty); - try - { - if (jvmmempc != null) - { - int trypercent = Integer.parseInt(jvmmempc); - if (0 < trypercent && trypercent <= 100) - { - percent = trypercent; - } - else - { - System.out.println("Property '" + maxHeapSizePerCentProperty - + "' should be in range 1..100"); - } - } - } catch (Exception e) - { - System.out.println("Error parsing " + maxHeapSizePerCentProperty - + " '" + jvmmempc + "'"); - } - - try - { - maxMemLong = MemorySetting.memPercent(percent); - } catch (Exception e) - { - e.printStackTrace(); - } catch (Throwable t) - { - t.printStackTrace(); - } - + long maxMemLong = MemorySetting.getMemorySetting(); + if (maxMemLong > 0) { memSetting = "-Xmx" + Long.toString(maxMemLong); @@ -130,6 +92,11 @@ public class Launcher System.out.println("Running " + startClass + " with " + (memSetting == null ? "no memSetting" : memSetting)); + if (System.getProperty("launcherstop") != null + && System.getProperty("launcherstop").equals("true")) + { + System.exit(0); + } try { builder.inheritIO();