From: Ben Soares
- Important! If you use --output
or any other argument that outputs a file, then it will be assumed you want to run Jalview in headless mode (as if you had specified --headless
). To use Jalview with --output
and not assume headless mode, use the --gui
or --noheadless
argument (the order doesn't matter).
+ Important! If you use --output
or any other argument that outputs a file, then it will be assumed you want to run Jalview in headless mode (as if you had specified --headless
). To use Jalview with --output
and not assume headless mode, use the --gui
argument (the order doesn't matter).
+ If you would like to output an alignment file directly to standard output (often referred to as STDOUT), then use the filename -
(a single hyphen). In this case any messages that would normally appear on STDOUT will be diverted to STDERR to avoid invalidating the output file.
+
+ For example, to open a Stockholm file and pipe it to another command as a Block file, do +
+ jalview --open alignment1.stk --output - --format blc | another_command ++ or equivalently +
+ jalview alignment1.stk --output=[format=blc]- | another_command ++ +
--format
diff --cc src/jalview/bin/HiDPISetting.java
index 77228c0,3f57aed..e14c032
--- a/src/jalview/bin/HiDPISetting.java
+++ b/src/jalview/bin/HiDPISetting.java
@@@ -116,8 -117,8 +116,9 @@@ public class HiDPISettin
}
} catch (NumberFormatException e)
{
- System.err.println(setHiDPIScalePropertyName + " property give ("
- + setHiDPIScaleProperty + ") but not parseable as integer");
- jalview.bin.Console.errPrintln(setHiDPIScalePropertyName + " property give ("
- + setHiDPIScaleProperty + ") but not parseable as integer");
++ jalview.bin.Console.errPrintln(setHiDPIScalePropertyName
++ + " property give (" + setHiDPIScaleProperty
++ + ") but not parseable as integer");
}
}
if (setHiDPI && setHiDPIScale > 0)
@@@ -134,8 -135,8 +135,8 @@@
try
{
int existingPropertyVal = Integer.parseInt(existingProperty);
- System.out.println("Existing " + scalePropertyName + " is "
- + existingPropertyVal);
- jalview.bin.Console.outPrintln("Existing " + scalePropertyName + " is "
- + existingPropertyVal);
++ jalview.bin.Console.outPrintln("Existing " + scalePropertyName
++ + " is " + existingPropertyVal);
if (existingPropertyVal > 1)
{
setHiDPIScale(existingPropertyVal);
@@@ -143,8 -144,8 +144,9 @@@
}
} catch (NumberFormatException e)
{
- System.out.println("Could not convert property " + scalePropertyName
- + " vale '" + existingProperty + "' to number");
- jalview.bin.Console.outPrintln("Could not convert property " + scalePropertyName
- + " vale '" + existingProperty + "' to number");
++ jalview.bin.Console.outPrintln(
++ "Could not convert property " + scalePropertyName
++ + " vale '" + existingProperty + "' to number");
}
}
@@@ -158,11 -159,7 +160,11 @@@
dpi = screenInfo.getScreenResolution();
} catch (HeadlessException e)
{
- jalview.bin.Console.errPrintln("Cannot get screen resolution: " + e.getMessage());
+ if (isLinux)
+ {
- System.err
- .println("Cannot get screen resolution: " + e.getMessage());
++ jalview.bin.Console.errPrintln(
++ "Cannot get screen resolution: " + e.getMessage());
+ }
}
// try and get screen size height and width
@@@ -174,11 -171,8 +176,12 @@@
mindimension = Math.min(height, width);
} catch (HeadlessException e)
{
- jalview.bin.Console.errPrintln(
- "Cannot get screen size height and width:" + e.getMessage());
+ if (isLinux)
+ {
- System.err.println("Cannot get screen size height and width:"
- + e.getMessage());
++ jalview.bin.Console
++ .errPrintln("Cannot get screen size height and width:"
++ + e.getMessage());
+ }
}
// attempt at a formula for scaling based on screen dpi and mindimension.
diff --cc src/jalview/bin/Launcher.java
index 20a466b,77992f5..e1415be
--- a/src/jalview/bin/Launcher.java
+++ b/src/jalview/bin/Launcher.java
@@@ -64,19 -85,49 +64,21 @@@ public class Launche
{
if (!LaunchUtils.checkJavaVersion())
{
- System.err.println("WARNING - The Java version being used (Java "
- + LaunchUtils.getJavaVersion()
- + ") may lead to problems. This installation of Jalview should be used with Java "
- + LaunchUtils.getJavaCompileVersion() + ".");
- jalview.bin.Console.errPrintln("WARNING - The Java version being used (Java "
- + LaunchUtils.getJavaVersion()
- + ") may lead to problems. This installation of Jalview should be used with Java "
- + LaunchUtils.getJavaCompileVersion() + ".");
- }
- final String appName = ChannelProperties.getProperty("app_name");
- final String javaBinDir = System.getProperty("java.home")
- + File.separator + "bin" + File.separator;
- String javaBin = null;
- if (javaBin == null && checkJVMSymlink(javaBinDir + appName))
- {
- javaBin = javaBinDir + appName;
- }
- if (javaBin == null && checkJVMSymlink(javaBinDir + "Jalview"))
- {
- javaBin = javaBinDir + "Jalview";
++ jalview.bin.Console
++ .errPrintln("WARNING - The Java version being used (Java "
++ + LaunchUtils.getJavaVersion()
++ + ") may lead to problems. This installation of Jalview should be used with Java "
++ + LaunchUtils.getJavaCompileVersion() + ".");
}
- if (javaBin == null)
- {
- javaBin = "java";
- }
-
- List