Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.lang.NoClassDefFoundError:org/hamcrest/selfdescription,尽管类路径上有hamcrest_Java_Ant_Junit5_Hamcrest - Fatal编程技术网

java.lang.NoClassDefFoundError:org/hamcrest/selfdescription,尽管类路径上有hamcrest

java.lang.NoClassDefFoundError:org/hamcrest/selfdescription,尽管类路径上有hamcrest,java,ant,junit5,hamcrest,Java,Ant,Junit5,Hamcrest,当试图通过Antjunitlauncher任务运行JUnit 5测试时,我收到以下消息: [junitlauncher]警告:ID为“junit jupiter”的TestEngine无法执行测试 [junitlauncher]java.lang.NoClassDefFoundError:org/hamcrest/selfdescription 如何修复此问题,以便运行测试 类似问题的答案(例如)主要是为了确保hamcrest在课堂上。我已经使用打印测试类路径目标(有关详细信息,请参阅下面的构建

当试图通过Ant
junitlauncher
任务运行JUnit 5测试时,我收到以下消息:

[junitlauncher]警告:ID为“junit jupiter”的TestEngine无法执行测试 [junitlauncher]java.lang.NoClassDefFoundError:org/hamcrest/selfdescription

如何修复此问题,以便运行测试

类似问题的答案(例如)主要是为了确保hamcrest在课堂上。我已经使用
打印测试类路径
目标(有关详细信息,请参阅下面的构建文件)验证了我用于运行测试的类路径包括
hamcrest-2.1.jar
。此外,测试编译时没有任何问题

以下是我认为与我的build.xml相关的部分:


类路径为${classpathInName}

您正在使用哪个JUnit版本?JUnit Jupiter。引擎和API 5.5.1,平台1.5.1是否通过降级当前版本进行检查?喜欢5.3.2吗?