diff --git a/hutool-core/src/main/java/org/dromara/hutool/core/net/url/UrlUtil.java b/hutool-core/src/main/java/org/dromara/hutool/core/net/url/UrlUtil.java index 34f2048b2..f9d111c83 100644 --- a/hutool-core/src/main/java/org/dromara/hutool/core/net/url/UrlUtil.java +++ b/hutool-core/src/main/java/org/dromara/hutool/core/net/url/UrlUtil.java @@ -125,6 +125,14 @@ public class UrlUtil { try { return new URL(null, url, handler); } catch (final MalformedURLException e) { + // issue#I8PY3Y + if(e.getMessage().contains("Accessing an URL protocol that was not enabled")){ + // Graalvm打包需要手动指定参数开启协议: + // --enable-url-protocols=http + // --enable-url-protocols=https + throw new HutoolException(e); + } + // 尝试文件路径 try { return new File(url).toURI().toURL();