mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Native libraries: Fixed IllegalArgumentException: URI scheme is not "file" when using FlatLaf in WebStart. (issue #668; regression in FlatLaf 3.1)
This commit is contained in:
@@ -8,6 +8,8 @@ FlatLaf Change Log
|
||||
"Material Theme UI Lite" themes; issue #667; regression in FlatLaf 3.1).
|
||||
- Fixed too large tree row height in "Carbon", "Dark Purple", "Gray",
|
||||
"Material Design Dark", "Monokai Pro", "One Dark" and "Spacegray" themes.
|
||||
- Native libraries: Fixed `IllegalArgumentException: URI scheme is not "file"`
|
||||
when using FlatLaf in WebStart. (issue #668; regression in FlatLaf 3.1)
|
||||
|
||||
|
||||
## 3.1
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.formdev.flatlaf.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.security.CodeSource;
|
||||
import com.formdev.flatlaf.FlatSystemProperties;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.NativeLibrary;
|
||||
@@ -128,10 +129,15 @@ class FlatNativeLibrary
|
||||
private static File findLibraryBesideJar( String classifier, String ext ) {
|
||||
try {
|
||||
// get location of FlatLaf jar
|
||||
URL jarUrl = FlatNativeLibrary.class.getProtectionDomain().getCodeSource().getLocation();
|
||||
CodeSource codeSource = FlatNativeLibrary.class.getProtectionDomain().getCodeSource();
|
||||
URL jarUrl = (codeSource != null) ? codeSource.getLocation() : null;
|
||||
if( jarUrl == null )
|
||||
return null;
|
||||
|
||||
// if url is not a file, then we're running in a special environment (e.g. WebStart)
|
||||
if( !"file".equals( jarUrl.getProtocol() ) )
|
||||
return null;
|
||||
|
||||
File jarFile = new File( jarUrl.toURI() );
|
||||
|
||||
// if jarFile is a directory, then we're in a development environment
|
||||
|
||||
Reference in New Issue
Block a user