Skip to content

Commit

Permalink
Native window decorations: catch UnsatisfiedLinkError when trying t…
Browse files Browse the repository at this point in the history
…o load `jawt.dll` to avoid an application crash (Java 8 on Windows 10 only)
  • Loading branch information
DevCharly committed Oct 14, 2021
1 parent ae28c59 commit efcbc1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
FlatLaf Change Log
==================

## 1.6.1-SNAPSHOT

#### Fixed bugs

- Native window decorations: Catch `UnsatisfiedLinkError` when trying to load
`jawt.dll` to avoid an application crash (Java 8 on Windows 10 only).


## 1.6

#### New features and improvements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ static FlatNativeWindowBorder.Provider getInstance() {
// Java 9 and later does not have this problem.
try {
System.loadLibrary( "jawt" );
} catch( UnsatisfiedLinkError ex ) {
// log error only if native library jawt.dll not already loaded
String message = ex.getMessage();
if( message == null || !message.contains( "already loaded in another classloader" ) )
LoggingFacade.INSTANCE.logSevere( null, ex );
} catch( Exception ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
Expand Down

0 comments on commit efcbc1f

Please sign in to comment.