JFormDesigner / FlatLaf

FlatLaf - Swing Look and Feel (with Darcula/IntelliJ themes support)
https://www.formdev.com/flatlaf/
Apache License 2.0
3.42k stars 272 forks source link

flatlaf-demo-1.6.4.jar exits with UnsatisfiedLinkError on AdoptOpenJDK build 11.0.7+10 #436

Closed ThisOtterBeGood closed 2 years ago

ThisOtterBeGood commented 2 years ago

java -version:

openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)

Exception:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: 'long com.formdev.flatlaf.ui.FlatWindowsNativeWindowBorder$WndProc.installImpl(java.awt.Window)'
        at com.formdev.flatlaf.ui.FlatWindowsNativeWindowBorder$WndProc.installImpl(Native Method)
        at com.formdev.flatlaf.ui.FlatWindowsNativeWindowBorder$WndProc.<init>(FlatWindowsNativeWindowBorder.java:318)
        at com.formdev.flatlaf.ui.FlatWindowsNativeWindowBorder.install(FlatWindowsNativeWindowBorder.java:166)
        at com.formdev.flatlaf.ui.FlatWindowsNativeWindowBorder.setHasCustomDecoration(FlatWindowsNativeWindowBorder.java:142)
        at com.formdev.flatlaf.ui.FlatNativeWindowBorder.setHasCustomDecoration(FlatNativeWindowBorder.java:234)
        at com.formdev.flatlaf.ui.FlatNativeWindowBorder.install(FlatNativeWindowBorder.java:130)
        at com.formdev.flatlaf.ui.FlatNativeWindowBorder.lambda$install$0(FlatNativeWindowBorder.java:101)
        at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341)
        at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:334)
        at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266)
        at java.desktop/java.awt.Component.firePropertyChange(Component.java:8727)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4784)
        at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:733)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/java.awt.Window.addNotify(Window.java:786)
        at java.desktop/java.awt.Frame.addNotify(Frame.java:490)
        at java.desktop/java.awt.Window.pack(Window.java:824)
        at com.formdev.flatlaf.demo.FlatLafDemo.lambda$main$0(FlatLafDemo.java:64)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        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)
Nibby commented 2 years ago

Bump. This exception happened to us after a user reported this issue after installing a system update for Windows.

DevCharly commented 2 years ago

Unfortunately can not reproduce this exception...

Seems that extracting the DLL from flatlaf.jar to temporary folder works fine. Also loading the DLL seems go well. But invoking a method in the DLL fails...

Could you please run following on command line and post the output:

dir %TEMP%\flatlaf.temp
java -XshowSettings:properties -version
DevCharly commented 2 years ago

Does this occur on every start? Or occasionally?

ThisOtterBeGood commented 2 years ago

I'm sorry I hadn't have time to test last week. I just realize it might be a problem with our corporate execution policy, so you might want to stop investigating until i can hash that out.

DevCharly commented 2 years ago

@ThisOtterBeGood thanks for the info. This could be the reason.

I've modified the code to catch the UnsatisfiedLinkError and continue with standard window decorations.

A updated demo is in the build artifacts here (at the bottom): https://github.com/JFormDesigner/FlatLaf/actions/runs/1547109693

@Nibby please try the latest 1.6.5-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

ThisOtterBeGood commented 2 years ago

It's our execution policy. It prohibits the usage of ('%temp%\flatlaf.temp\flatlaf-windows-x86_64-9110333436000.dll"

That snapshot works: https://github.com/JFormDesigner/FlatLaf/actions/runs/1547109693 grafik

Thank you so much!

DevCharly commented 2 years ago

@ThisOtterBeGood many thanks for the update.

FlatLaf 1.6.5 released