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.
我在 NetBeans 中有一个带有 JUnit 测试的项目。我对依赖项目中的方法返回类型进行了更改,应用程序运行良好。但是当我从 NetBeans 内部运行 JUnit 测试时,我得到了 NoSuchMethodError。我确保清洁和建造。
解决方案是对调用更改方法的类进行更改(任何更改)。然后我保存了课程,然后撤消了更改并保存了课程。然后在 NetBeans 中运行 JUnit 测试就可以了。这似乎是 NetBeans 缓存的错误。我以前遇到过类似的奇怪问题,我不得不关闭 NetBeans,删除 NetBeans 缓存文件夹,然后重新启动 NetBeans。但似乎对该类进行更改(然后撤消它)足以修复 NetBeans 缓存。