找不到类 Java JUnit
我是 Java 初学者。你能帮我找出错误吗? 我在 Windows 中使用命令行从项目的根文件夹运行此命令。
java -classpath lib/junit.jar;classes/ua/edu/sumdu/j2se/savchenko/pr2/Task.class
org.junit.runner.JUnitCore ua.edu.sumdu.j2se.savchenko.pr2.tests.TaskTest
我的文件位置:
classes/ua/edu/sumdu/j2se/savchenko/pr2/Task.class
classes/ua/edu/sumdu/j2se/savchenko/pr2/tests/TaskTest.class
lib/junit.jar
I'm begginer in Java. Can you help me to find error?
I run this using command line in Windows from the root folder of project.
java -classpath lib/junit.jar;classes/ua/edu/sumdu/j2se/savchenko/pr2/Task.class
org.junit.runner.JUnitCore ua.edu.sumdu.j2se.savchenko.pr2.tests.TaskTest
My files location:
classes/ua/edu/sumdu/j2se/savchenko/pr2/Task.class
classes/ua/edu/sumdu/j2se/savchenko/pr2/tests/TaskTest.class
lib/junit.jar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的类路径应该只包含类层次结构的根,而不是类的完整路径。
另外,在提问时包括确切的错误是什么也很重要,否则我们通常会猜测。
Your class path should only include the root of the class hierarchy, not the complete path to a class.
Also, it's important to include what the exact error is when asking questions, otherwise we're usually guessing.