解决执行Junit单元测试报错java.lang.ClassNotFoundException问题
作者:wangxiaoming
执行Junit单元测试报错java.lang.ClassNotFoundException
现象
Class not found TestTransaction
java.lang.ClassNotFoundException: TestTransaction
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:685)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
windows-prefrences->Java-------->compiler------->building------->Buil path problems -------> incomplete build path 和 Circular dependencies改成warning就可以了。
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。