我cglib在 Maven 项目中有一个传递依赖项。尽管添加了我认为正确的内容,但--add-opens我无法让库与 Java 16 一起使用。
如何开始cglib使用 Java 16?我在github页面上提出了这个问题。
最小可重现示例:
Main.java
import net.sf.cglib.proxy.Enhancer;
public class Main {
public static void main(String[] args) {
new Enhancer();
}
}
Run Code Online (Sandbox Code Playgroud)
使用 Java 15:
javac -cp cglib-3.3.0.jar Main.java
java --add-opens java.base/java.lang=ALL-UNNAMED -cp cglib-3.3.0.jar:asm-7.1.jar:. Main
Picked up _JAVA_OPTIONS: -Duser.language=en -Duser.country=GB
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/Users/rbain/Desktop/cglib-3.3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of …Run Code Online (Sandbox Code Playgroud)