diff --git a/src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/JdkCompiler.java b/src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/JdkCompiler.java index d00d426..956e72a 100644 --- a/src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/JdkCompiler.java +++ b/src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/JdkCompiler.java @@ -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 files = new ArrayList(); boolean isInternalJar = false; @@ -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