BEAST2/BEAUti GUIs don't open with Java JDK 9

432 views
Skip to first unread message

michaelm

unread,
Oct 17, 2017, 1:16:46 PM10/17/17
to beast-users
Hi all,

I'm currently teaching phylogenetics with BEAST 2, and several students had issues getting BEAST 2 or BEAUti to run on their machines. They had not had Java installed so we installed the latest version, Java JDK 9. After that, attempting to open BEAST 2 or BEAUti GUI applications resulted in the icon appearing briefly but the GUI didn't open.

I then tried to replicate this on my machine, updated from JDK 8 to JDK 9, and got the same issue. I tried launching BEAUti from the command line using launcher.jar, and this is what I got:

$ java -version

java version "9"

Java(TM) SE Runtime Environment (build 9+181)

Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

$ java -cp /Applications/Beast/2.4.7/lib/launcher.jar beast.app.beauti.BeautiLauncher

Checking out /Users/m_matschiner/Library/Application Support/BEAST/2.4/BEAST/lib

Exception in thread "main" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader

at beast.app.beastapp.BeastLauncher.checkForBEAST(Unknown Source)

at beast.app.beastapp.BeastLauncher.loadBEASTJars(Unknown Source)

at beast.app.beauti.BeautiLauncher.main(Unknown Source)


After removing JDK 9 again, double-clicking the application icon still doesn't open BEAST 2 or BEAUti, but starting BEAUti with launcher.jar works:

$ sudo mv /Library/Java/JavaVirtualMachines/jdk-9.jdk/ Desktop/

Password:

$ java -version

java version "1.8.0_31"

Java(TM) SE Runtime Environment (build 1.8.0_31-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

$ java -cp /Applications/Beast/2.4.7/lib/launcher.jar beast.app.beauti.BeautiLauncher

Checking out /Users/m_matschiner/Library/Application Support/BEAST/2.4/BEAST/lib

Loaded URL file:/Users/m_matschiner/Library/Application Support/BEAST/2.4/BEAST/lib/beast.jar

jardir = /Applications/Beast/2.4.7/lib/launcher.jar

Loading package BEAST v2.4.7

Loading package BEAST v2.4.7

Loading package BEASTLabs v1.7.1

...

Do you have any idea where this issue with JDK 9 might come from?

Cheers,
Michael

Huw A. Ogilvie

unread,
Oct 17, 2017, 8:47:51 PM10/17/17
to beast-users
Hi Michael,

Java 9 makes big changes to how some Java classes used by BEAST2 are packaged, so BEAST2 is not compatible yet. Based on historical patterns, a subsequent major update to BEAST2 will be compatible with and require Java 9.

- Huw

michaelm

unread,
Oct 18, 2017, 3:42:59 AM10/18/17
to beast-users
Thanks, Huw.

Then I'll try to remove JDK 9 completely again.

Cheers,
Michael
Reply all
Reply to author
Forward
0 new messages