【发布时间】:2017-06-08 18:39:02
【问题描述】:
我正在使用 jdk-9,我想在我的代码中使用 sun.reflect.* 包,但我收到以下异常
Exception in thread 'main' java.lang.IllegalAccessError : class Test (in moudle: Unnamed Module) cannot access class sun.reflect.Reflaction (in module:java.base), sun.reflect is not exported to Unnamed module
当我使用 JDK-9 运行下面的示例代码时
public static void main(String args[]){
System.out.println(Reflection.getCallerClass(3));
}
【问题讨论】:
标签: java java-9 java-platform-module-system