albfan / jmeld

A visual diff and merge tool
44 stars 31 forks source link

java.lang.IllegalAccessError: jidesoft #72

Closed weatherfire closed 2 years ago

weatherfire commented 2 years ago

Getting an Error running from cmd:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: class com.jidesoft.plaf.LookAndFeelFactory (in unnamed module @0x123bb025) cannot access class com.sun.java.swing.plaf.windows.WindowsLookAndFeel (in module java.desktop) because module java.desktop does not export com.sun.java.swing.plaf.windows to unnamed module @0x123bb025
        at com.jidesoft.plaf.LookAndFeelFactory.getDefaultStyle(LookAndFeelFactory.java:539)
        at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:598)
        at org.jmeld.ui.util.LookAndFeelManager.install(LookAndFeelManager.java:60)
        at org.jmeld.JMeld.run(JMeld.java:49)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Seems relating this one here: https://github.com/jidesoft/jide-oss/issues/26

albfan commented 2 years ago

What's the Java jdk you're using? Looks to me you use an openjdk that do not provide com.sun.java.swing.plaf.windows.WindowsLookAndFeel

I'm unsure about that though, there're workarounds on mentioned issue, but nothing relevant for this project, which is agnostic to OS L&F

weatherfire commented 2 years ago

Thank you, that is what I was afraid of. Indeed I currently have to use openjdk. no other option this year.

openjdk version "18.0.1.1" 2022-04-22

OpenJDK Runtime Environment (build 18.0.1.1+2-6)

OpenJDK 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

Any idea whether it should work with Corretto?

albfan commented 2 years ago

Looks Corretto is a amazon jdk? I'm unsure what L&F they support, probably there're codes out there to list available ones.

I think any of this solutions:

Set this system property: -Djide.defaultStyle=1

Call this before creating any jide components: LookAndFeelFactory.installJideExtension(LookAndFeelFactory.EXTENSION_STYLE_VSNET);

should work, if you don't want to change code, use the first one