ropensci / beastier

R package to run BEAST2
https://docs.ropensci.org/beastier
GNU General Public License v3.0
11 stars 1 forks source link

Support Windows when using BEAST2 packages #34

Closed richelbilderbeek closed 5 years ago

richelbilderbeek commented 5 years ago

Modify create_beast2_cmd_run as described here

richelbilderbeek commented 5 years ago

From http://www.beast2.org/2018/04/10/what-is-new-in-v2.5.0.html:

BEAST

There is now a -D option for BEAST that takes as argument a comma separated string with name-value pairs, e.g. -D "chain_length=10000000,log_every=1000". Every occurrence of $(name) will be replaced by value in the XML in a pre-processing step, so for instance $(chain_length) will be replaced by 10000000 and $(log_every) with 1000 in the example above.

As a consequence of package jar files being stored in the file beauti.properties instead of being discovered on the fly, when you start BEAST with

java -jar beast.jar

the class path is not set, so packages will not be loaded, so if you need extra packages BEAST will fail. To get the v2.4.x behaviour back, you can start with

java -Dbeast.load.jars=true -jar beast.jar

and packages will be discovered dynamically. Note this only works with Java 8. With Java 9, jar loading has been changed considerably, so that is why v2.5.0 (which should work with Java 9) behaves differently than before.

richelbilderbeek commented 5 years ago

The above is old, see http://www.beast2.org/2019/07/08/what-is-new-in-v2.6.0.html:

Robustify application launching and package upgrading

Package loading changed between Java 8 and 9, which was dealt with in v2.5.x by having a launcher process find all packages and kick off a new process for BEAST, BEAUti, etc, with the correct class path for Java. This caused a number of hard to resolve problems with security software. Release v2.6.0 runs everything in a single process (just like v2.4.x and before), which should be more robust. This is especially useful for Windows, where upgrading packages did not always work when Java (versions > 8) was installed.

One implication is that java -jar beast.jar should not be used any more (in fact, it does not start BEAST any more), but instead use

java -jar /path/to/lib/launcher.jar ...

where /path/to/ is the path to the file lib/launcher.jar, which is part of the BEAST distribution. There is no need to use the -Dload.beast.user.packages=true directive any more (this is in fact ignored now).

richelbilderbeek commented 5 years ago

Too bad, didn't work...