Can I run Jalview from the command line?

Yes. The Jalview Desktop has a number of command line options, but how you access them depends on the way you want to launch Jalview:

1. If you use Java Web Start to launch Jalview, then on some versions of Java Webstart you can start up Jalview with a specific file by typing:

javaws -open yourFileName

This is fine for launching the desktop with prepared data, but less useful for batch processing since any console output will be written to the java console.

2. If you installed the InstallAnywhere version of Jalview you can run the application binary with additional arguments. However any output from the application will be sent to a file called output.txt in the directory where you installed Jalview, rather than to the command's standardĀ output channel.

3. To use Jalview like a command line program from a terminal, we recommend you use the following command (you could also put this in a shell or batch script).

java -classpath "$INSTALL_DIR$/jalview.jar:$INSTALL_DIR$/lib/*"
jalview.bin.Jalview -open [FILE]

Where $INSTALL_DIR$ is the InstallAnywhere installation directory.

When compiling from source, use:
java -classpath "$SOURCE_DIR$/dist/*"
jalview.bin.Jalview -open [FILE]

Use -help to list the current set of arguments Jalview supports. The online documentation also includes a list of jalview command line parameters

Note: This FAQ has been updated - we no longer recommend the -Djava.ext.dirs=lib argument since it prevents Jalview from accessing some web services, and will be disabled in future versions of Java.

Question Type: