在我的项目中运行测试时出现以下错误:
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @XXXXXX
我正在使用测试方法旁边的绿色运行箭头来执行此处指定的测试。
诸如这些之类的解决方案可能会有所帮助,但我不确定在这种情况下如何传递命令行参数
--add-opens=java.base/java.lang=ALL-UNNAMED
,以在上面指定的方法中运行测试时添加。?