cannot access class com.apple.eawt.Application because module java.desktop does not export com.apple.eawt to module jgaf
Closed this issue · 5 comments
Hi,
Got this exception on macosx catalina with jdk 11.
Seems not being able to load EAWT as it is not exported anymore.
using jGAF version 2.3,
Am i doing something wrong ?
Mar. 25, 2020 7:54:51 P.M. com.plealog.genericapp.api.log.EZLogger warn
WARNING: jgaf@2.3.0/com.plealog.genericapp.ui.apple.OSXAdapter.setHandler(Unknown Source): Mac OS X Adapter could not talk to EAWT:java.lang.IllegalAccessException: class com.plealog.genericapp.ui.apple.OSXAdapter (in module jgaf) cannot access class com.apple.eawt.Application (in module java.desktop) because module java.desktop does not export com.apple.eawt to module jgaf
Mar. 25, 2020 7:54:51 P.M. com.plealog.genericapp.api.log.EZLogger warn
WARNING: jgaf@2.3.0/com.plealog.genericapp.ui.apple.OSXAdapter.setHandler(Unknown Source): Mac OS X Adapter could not talk to EAWT:java.lang.IllegalAccessException: class com.plealog.genericapp.ui.apple.OSXAdapter (in module jgaf) cannot access class com.apple.eawt.Application (in module java.desktop) because module java.desktop does not export com.apple.eawt to module jgaf
Mar. 25, 2020 7:54:51 P.M. com.plealog.genericapp.api.log.EZLogger warn
WARNING: jgaf@2.3.0/com.plealog.genericapp.ui.apple.OSXAdapter.setAboutHandler(Unknown Source): OSXAdapter could not access the About Menu
Mar. 25, 2020 7:54:51 P.M. com.plealog.genericapp.api.log.EZLogger warn
WARNING: jgaf@2.3.0/com.plealog.genericapp.ui.apple.OSXAdapter.setHandler(Unknown Source): Mac OS X Adapter could not talk to EAWT:java.lang.IllegalAccessException: class com.plealog.genericapp.ui.apple.OSXAdapter (in module jgaf) cannot access class com.apple.eawt.Application (in module java.desktop) because module java.desktop does not export com.apple.eawt to module jgaf
Mar. 25, 2020 7:54:51 P.M. com.plealog.genericapp.api.log.EZLogger warn
WARNING: jgaf@2.3.0/com.plealog.genericapp.ui.apple.OSXAdapter.setPreferencesHandler(Unknown Source): OSXAdapter could not access the About Menu
Exception in thread "main" java.lang.NullPointerException
at jgaf@2.3.0/com.plealog.genericapp.api.EZGenericApplication.initialize(Unknown Source)
at cptorderflow/com.cpt.orderflow.ui.OrderFlowApp.main(OrderFlowApp.java:140)
Hi,
I did not test jGAF with JRE 9 or above, yet... so I do not know if there is a change somewhere in the JDK regarding the use OSXAdapter class.
Considering the stack trace you've reported: "com.apple.eawt.Application" seems to be not reachable anymore in JDK 11.
Hi,
I've found an interesting article on Oracle's JDK 12 :
https://docs.oracle.com/en/java/javase/12/migrate/index.html
see section "Removed macOS-Specific Features".
A versy interesting information is : "The APIs in the com.apple.eawt and com.apple.eio packages are encapsulated, so you won’t be able to compile against them in JDK 9 or later releases. However, they remain accessible at runtime, so existing code that is compiled to old versions continues to run. "
Now, I have to review all of these and figure out how I can migrate jGAF to more recent JDK, still maintaining compatibility with JDK 8, because I have production systems still working with that release of Java. ANy help in doing that update of jGAF would be greatly appreciated.
Patrick
Issue fixed with jGAF 2.4.0 release.