// Run Commands from cli
cmds = new Commands(argparser, headlessArg);
boolean commandsSuccess = cmds.argsWereParsed();
+
if (commandsSuccess)
{
if (headlessArg)
}
else
{
+ // record usage stats if in headless mode
+ if (Cache.getDefault("USAGESTATS", false))
+ {
+ Cache.initGoogleTracker(headlessArg);
+ }
Jalview.exit("Successfully completed commands in headless mode",
0);
}
{
private final static String startClass = "jalview.bin.Jalview";
+ private final static String headlessProperty = "java.awt.headless";
+
private static boolean checkJVMSymlink(String testBin)
{
File testBinFile = new File(testBin);
boolean debug = false;
boolean wait = true;
boolean quiet = false;
+ boolean headless = false;
// must set --debug before --launcher...
boolean launcherstop = false;
boolean launcherprint = false;
{
quiet = true;
}
+ if (arg.equals("--headless"))
+ {
+ headless = true;
+ }
if (debug && arg.equals("--launcherprint"))
{
launcherprint = true;
boolean memSet = false;
boolean dockIcon = false;
boolean dockName = false;
+ boolean headlessProp = false;
for (int i = 0; i < command.size(); i++)
{
String arg = command.get(i);
{
dockName = true;
}
+ else if (arg.startsWith("-D" + headlessProperty + "="))
+ {
+ headlessProp = true;
+ }
}
if (!memSet)
+ appName);
}
}
+ if (headless && !headlessProp)
+ {
+ System.setProperty(headlessProperty, "true");
+ command.add("-D" + headlessProperty + "=true");
+ }
String scalePropertyArg = HiDPISetting.getScalePropertyArg();
if (scalePropertyArg != null)
ISMACOS=1
fi
+# check for headless mode
+HEADLESS=0
+for ARG in ARGS; do
+ if [ "${ARG}" = "--headless" ]; then
+ HEADLESS=1
+ break
+ fi
+done
+
declare -a JVMARGS=()
# set vars for being inside the macos App Bundle
JAVA="${APPDIR}/jre/bin/java"
fi
+if [ "${HEADLESS}" = 1 ]; then
+ # this suppresses the Java icon appearing in the macOS Dock and maybe other things in other OSes
+ JVMARGS=( "${JVMARGS[@]}" "-Djava.awt.headless=true" )
+fi
+
SYSJAVA=java
GETDOWNTXT="${APPDIR}/getdown.txt"