最近我正在将项目从 JDK 11 升级到 JDK 17。升级后,powermock 似乎出现问题。运行 AUT 时,出现以下错误:
java.lang.RuntimeException: PowerMock internal error: Should never throw exception at this level
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @3fc34119
Run Code Online (Sandbox Code Playgroud)
您是否知道此问题的任何解决方法,如果可以,请提供解决方案。