import java.util.Locale;
import java.util.concurrent.TimeUnit;
+import jalview.bin.argparser.Arg;
import jalview.util.ChannelProperties;
import jalview.util.LaunchUtils;
* A Launcher class for Jalview. This class is used to launch Jalview from the
* shadowJar when Getdown is not used or available. It attempts to take all the
* command line arguments to pass on to the jalview.bin.Jalview class, but to
- * insert a -Xmx memory setting to a sensible default, using the -jvmmempc and
+ * insert a -Xmx memory setting to a sensible default, using the --jvmmempc and
* -jvmmemmax application arguments if specified. If not specified then system
* properties will be looked for by jalview.bin.MemorySetting. If the user has
- * provided the JVM with a -Xmx setting directly and not set -jvmmempc or
- * -jvmmemmax then this setting will be used and system properties ignored. If
- * -Xmx is set as well as -jvmmempc or -jvmmemmax as argument(s) then the -Xmx
+ * provided the JVM with a -Xmx setting directly and not set --jvmmempc or
+ * --jvmmemmax then this setting will be used and system properties ignored. If
+ * -Xmx is set as well as --jvmmempc or --jvmmemmax as argument(s) then the -Xmx
* argument will NOT be passed on to the main application launch.
*
* @author bsoares
/**
* main method for jalview.bin.Launcher. This restarts the same JRE's JVM with
- * the same arguments but with memory adjusted based on extracted -jvmmempc
- * and -jvmmemmax application arguments. If on a Mac then extra dock:icon and
+ * the same arguments but with memory adjusted based on extracted --jvmmempc
+ * and --jvmmemmax application arguments. If on a Mac then extra dock:icon and
* dock:name arguments are also set.
*
* @param args
}
// jvmmempc and jvmmemmax args used to set memory and are not passed on to
// startClass
- if (arg.startsWith(
- "-" + MemorySetting.MAX_HEAPSIZE_PERCENT_PROPERTY_NAME + "="))
+ final String jvmmempcArg = Arg.JVMMEMPC.getName();
+ final String jvmmemmaxArg = Arg.JVMMEMMAX.getName();
+ if (arg.startsWith("-" + jvmmempcArg + "="))
{
- jvmmempc = arg.substring(
- MemorySetting.MAX_HEAPSIZE_PERCENT_PROPERTY_NAME.length()
- + 2);
+ jvmmempc = arg.substring(jvmmempcArg.length() + 2);
}
- else if (arg.startsWith(
- "-" + MemorySetting.MAX_HEAPSIZE_PROPERTY_NAME + "="))
+ else if (arg.startsWith("-" + jvmmemmaxArg + "="))
{
- jvmmemmax = arg.substring(
- MemorySetting.MAX_HEAPSIZE_PROPERTY_NAME.length() + 2);
+ jvmmemmax = arg.substring(jvmmemmaxArg.length() + 2);
}
// --doubledash versions
- else if (arg.startsWith("--"
- + MemorySetting.MAX_HEAPSIZE_PERCENT_PROPERTY_NAME + "="))
+ else if (arg.startsWith("--" + jvmmempcArg + "="))
{
- jvmmempc = arg.substring(
- MemorySetting.MAX_HEAPSIZE_PERCENT_PROPERTY_NAME.length()
- + 3);
+ jvmmempc = arg.substring(jvmmempcArg.length() + 3);
}
- else if (arg.startsWith(
- "--" + MemorySetting.MAX_HEAPSIZE_PROPERTY_NAME + "="))
+ else if (arg.startsWith("--" + jvmmemmaxArg + "="))
{
- jvmmemmax = arg.substring(
- MemorySetting.MAX_HEAPSIZE_PROPERTY_NAME.length() + 3);
+ jvmmemmax = arg.substring(jvmmemmaxArg.length() + 3);
}
// retain arg
else