JUnit报错: 误删target下面的.class编译文件
转载备忘遇到的坑 :https://www.cnblogs.com/xing901022/p/4135954.html
报错如下
Class not found com.mogodb.test.test java.lang.ClassNotFoundException: com.mogodb.test.test at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
查找对应的classes文件夹确实乜有发现响应的class文件生成。
查看项目确实选择了自动编译!
上网查找资料,发现了如下的解决办法:
只要把Java--------compiler-------building-------Buil path problems ------- incomplete build path 和 Circular dependencies改成warning就可以了。