beast2 icon indicating copy to clipboard operation
beast2 copied to clipboard

Make GUIs compatible with Java runtime >1.8

Open walterxie opened this issue 3 years ago • 2 comments

I think it'd better to log this issue, though it can be fixed to use "BEAST with JRE 1.8" :

  1. Use Oracle Java 16 in Mac to open BEAUti, the BEAUti About will not show a complete content. Look at the Messages from Help menu, module java.desktop does not export com.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)

walterxie avatar May 07 '21 00:05 walterxie

There seems a bug of OpenJDK 9 as well, but they would not fix it: https://bugs.openjdk.java.net/browse/JDK-8160437

walterxie avatar May 07 '21 00:05 walterxie

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.

tgvaughan avatar May 10 '21 09:05 tgvaughan

Using Java 17 and JavaFX now

walterxie avatar Nov 03 '22 21:11 walterxie