beast2
beast2 copied to clipboard
Make GUIs compatible with Java runtime >1.8
I think it'd better to log this issue, though it can be fixed to use "BEAST with JRE 1.8" :
- Use Oracle
Java 16
in Mac to openBEAUti
, theBEAUti About
will not show a complete content. Look at theMessages
fromHelp
menu, modulejava.desktop
does not exportcom.apple.eawt
.
Exception while loading the OSXAdapter:
java.lang.IllegalAccessException: class beast.app.util.NewOSXAdapter cannot access class com.apple.eawt.Application
(in module java.desktop) because module java.desktop does not export com.apple.eawt to unnamed module @126945f9
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:687)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:489)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at beast.app.util.NewOSXAdapter.registerMacOSXApplication(Unknown Source)
at beast.app.util.Utils.macOSXRegistration(Unknown Source)
at beast.app.beauti.Beauti.main2(Unknown Source)
at beast.app.beauti.Beauti.main(Unknown Source)
...
$ java -version
java version "16" 2021-03-16
Java(TM) SE Runtime Environment (build 16+36-2231)
There seems a bug of OpenJDK 9 as well, but they would not fix it: https://bugs.openjdk.java.net/browse/JDK-8160437
It sounds like this isn't a bug, but rather a deprecation. Following Java 9, the correct way of implementing platform-specific GUI code seems to be covered by JEP 272.
I.e. it's a bug that beast is trying to access com.apple.eawt.* classes for JDK >1.8.
Using Java 17 and JavaFX now