From 1a9d4c2c9ef79b42a18ffee4190f496d986f3b75 Mon Sep 17 00:00:00 2001 From: Looly Date: Wed, 20 Dec 2023 22:53:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgraalvm=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E6=89=93=E5=8C=85=E4=BD=BF=E7=94=A8http=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E8=A2=AB=E8=BD=AC=E4=B8=BAfile=E5=8D=8F=E8=AE=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/hutool/core/net/url/UrlUtil.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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();