[junit問題]我在使用junit時出現如下錯誤提示,編譯不過,不知是何原因?
錯誤:
E:\test> javac -d . MathToolUnitTest.java
MathToolUnitTest.java:4: cannot access junit.framework.TestCase
bad class file: E:\Java\junit4.0\junit-4.0.jar(junit/framework/TestCase.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import junit.framework.TestCase;
^
1 error
E:\test>
我試過用4.2和4.3的版本都試過,也一樣.不知是何原因?
[解决办法]
你用的是JUnit4.0,那需要用JDK5.0 才能运行。你现在机器里的JDK 版本是1.4 吧
[解决办法]
如果JDK为1.4,可以使用JUnit3.8
[解决办法]
关注一下
[解决办法]
我的jdk是1.4,junit是3.8的,可也出现了错误!
怎么回事??
[解决办法]
二楼的正解释