Skip to content

Commit

Permalink
Merge pull request #212 from iohao/master
Browse files Browse the repository at this point in the history
fix #211 jar error.evn:java21,springBoot3.2.
  • Loading branch information
jhunters authored May 21, 2024
2 parents 0e326bf + a57cfc3 commit 2e1e913
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public JdkCompiler(final ClassLoader loader, final String jdkVersion) {
if (loader instanceof URLClassLoader
&& (!loader.getClass().getName().equals("sun.misc.Launcher$AppClassLoader"))) {
try {
boolean isJava21 = "21".equals(System.getProperty("java.specification.version"));
URLClassLoader urlClassLoader = (URLClassLoader) loader;
List<File> files = new ArrayList<File>();
boolean isInternalJar = false;
Expand All @@ -143,6 +144,11 @@ public JdkCompiler(final ClassLoader loader, final String jdkVersion) {
file = StringUtils.removeStart(file, "file:");
}

if (isJava21 && file.startsWith("nested:")) {
// springBoot 3.2
file = StringUtils.removeStart(file, "nested:");
}

if (file.indexOf("!") != -1) {
// if has internal jar like
// file:/D:/develop/a.jar!/BOOT-INF/lib/spring-boot-starter-1.5.14.RELEASE.jar
Expand Down

0 comments on commit 2e1e913

Please sign in to comment.