On the bleeding edge with BEAST 2 -- using dev build from command line (and running BEAST faster on windows)

18 March 2014 by Remco Bouckaert

When a bug is discovered that holds you up, and it is relatively easy to fix, the fix may already be in the code but not released yet. The release process takes quite a bit of time, so it is not something we like to do very often. However, you can still use the fixed code (and possibly some new experimental code as well) by using the development build. Every time code is checked in, a new beast.jar file is build and made available for download from here. This file contains all runnable code for running BEAST and BEAUti, but not the BEAUti templates (XML files for setting up analyses in BEAUti). Only if all regression tests pass, the jar becomes available, so that should give some confidence that new code did not break any previous functionality.

I am assuming you already have BEAST installed before, so the Standard and StarBEAST BEAUti templates are on your computer. Note that it is important to store the beast.jar file in the lib folder (details below), so it picks up the BEAUti templates from the correct lcoation. For running BEAST, it does not matter
where you store the jar file.

Using beast.jar on Windows

When you download BEAST you get a zip file. I will assume that BEAST is unzipped on drive C, so there is a directory C:\BEAST. If it is located in another place, you will need to replace “C:\BEAST” with wherever BEAST is located.

1. Download beast.jar

First, download beast.jar and store it in C:\BEAST\lib.
The directory C:\BEAST\lib already contains the beast.jar file that comes with the release, which you might want to back-up. It is not used by BEAST.exe or BEAUti.exe, so it does not affect the installed GUI versions of BEAST and BEAUti.

2. Running BEAUti

To run BEAUti, open the Command Prompt window by clicking the Start button Picture of the Start button, clicking All Programs, clicking Accessories, and then clicking Command Prompt (more here
if you are not familiar with the cmd prompt). In the cmd screen, key in the
following two lines:

cd c:\BEAST
java -cp lib\beast.jar beast.app.beauti.Beauti

Update: for BEAST v2.5 to ensure packages are loaded use

cd c:\BEAST
java -Dbeast.load.jars=true -cp lib\beast.jar beast.app.beauti.Beauti

and the familiar BEAUti screen should be shown.

3. Running BEAST

To run BEAST on MyBEASTFile.xml, open a CMD prompt and key in the following:

cd c:\BEAST
java -jar lib\beast.jar MyBEASTFile.xml

Update: for BEAST v2.5 to ensure packages are loaded use

cd c:\BEAST
java -Dbeast.load.jars=true -jar lib\beast.jar MyBEASTFile.xml

Note: running from the command line tends to make
BEAST run faster on Windows, so that is another reason to use BEAST from the command line.

Note: use java -jar ... instead of java -cp ... as used for running BEAUti.

Using beast.jar on Mac

Assuming you installed BEAST in /Applications/BEAST 2.1.1/ where 2.1.1 is the version number of BEAST. If you installed another version, you have to replace wherever it says 2.1.1 below with that version number.

1. Download beast.jar

First download beast.jar and store it in /Applications/BEAST 2.1.1/lib.

2. Running BEAUti

To run BEAUti, open a terminal and key in the following two lines

cd /Applications/BEAST 2.1.1
java -cp lib/beast.jar beast.app.beauti.Beauti

Update: for BEAST v2.5 to ensure packages are loaded use

java -Dbeast.load.jars=true -cp lib/beast.jar beast.app.beauti.Beauti

and the familiar BEAUti screen should be shown.

3. Running BEAST

To run BEAST on MyBEASTFile.xml, open a CMD prompt and key in the following:

cd /Applications/BEAST 2.1.1
java -jar lib/beast.jar MyBEASTFile.xml

Update: for BEAST v2.5 to ensure packages are loaded use

java -Dbeast.load.jars=true -jar lib/beast.jar MyBEASTFile.xml

Note: use java -jar ... instead of java -cp ... as used for running BEAUti.

Using beast.jar on Linux

Like for Mac, but with /Applications/BEAST 2.1.1/ replaced with the directory where you installed BEAST.