Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK17环境下,JarClassLoader.loadJar()方法异常 #3601

Closed
js179 opened this issue May 29, 2024 · 0 comments
Closed

JDK17环境下,JarClassLoader.loadJar()方法异常 #3601

js179 opened this issue May 29, 2024 · 0 comments

Comments

@js179
Copy link

js179 commented May 29, 2024

版本情况

JDK版本: JDK17.0.10+11-LTS-240
hutool版本: 5.8.26(请确保最新尝试是否还有问题)

问题描述

原Jdk8环境下代码,在升级Jdk17过程中,出现了异常。

  1. 复现代码
        parent = PackagePath.class.getClassLoader();
        JarClassLoader.loadJar((URLClassLoader) parent, new File(properties.getProperty("lib")));
  1. 堆栈信息

  2. 测试涉及到的文件(注意脱密)

报错日志:class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoade

@js179 js179 closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant