Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尝试使用 Ibm 的 jdk8 在 eclipse Oxygen 上运行 JUnit 测试时出现此错误。
这个版本的jdk有什么已知的bug吗?我该如何解决/避免它?
似乎单元测试使用了目前不支持 IBM JDK 的 PowerMock。
PowerMock 尝试通过 HotSpot 附加机制加载代理,但它应该使用 J9 附加机制。
有关详细信息,请参阅以下问题:
如 apangin 所述,通过将 Mocking-Library 路径作为 VM 参数添加到 JRE 来工作。
要做到这一点:
Window→ Preferences→ Java→ Installed JREs:选择 JDK,编辑它并将以下内容添加到Default VM Arguments:
Window
Preferences
Java
Installed JREs
Default VM Arguments
-javaagent:<YOUR_M2_REPO_PATH>/org/jmockit/jmockit/1.9/jmockit-1.9.jar