更新时间:2022-05-13 06:17:29
您似乎在Windows而不是LINUX/UNIX下运行. Windows上的路径分隔符是;
,而不是:
.此外,您还没有将jar文件放在类路径中.所以你想要的是:
You seem to be running under Windows, not LINUX/UNIX. The path separator on Windows is ;
, not :
. Additionally, you haven't put you jar file in the classpath. So what you want is:
java -cp aJar.jar;junit-4.10.jar org.junit.runner.JUnitCore TestOne
这当然假定两个jar都在当前目录中.您还应该始终避免将类放入默认包中.
This of course assumes that both jars are in the current directory. You should also always avoid putting classes in the default package.