简体   繁体   中英

Could not find class Java JUnit

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
java -classpath lib/junit.jar;classes 
org.junit.runner.JUnitCore ua.edu.sumdu.j2se.savchenko.pr2.tests.TaskTest

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM