junit 5:从源代码构建导致异常

junit 5: build from source leads to exception

我正在尝试通过 gradle(OS X,el kapitan)从源代码构建 junit 5 签出:git 克隆 https://github.com/junit-team/junit5.git

运行 构建命令:gradlew clean assemble(或安装)

在这两种情况下我得到:

junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodArgumentsProvider.java:41: error: unreported exception X; must be caught or declared to be thrown
                                    .orElseThrow(() -> new JUnitException("Could not find method: " + methodName)))
                                                ^
  where X,T are type-variables:
X extends Throwable declared in method <X>orElseThrow(Supplier<? extends X>)
T extends Object declared in class Optional

有什么提示吗? 提前谢谢

这是 JDK 错误的结果,该错误已在 1.8_40 之后的某个时间点在发行版中得到纠正。尝试将您的 JDK 升级到最新版本。

参考:https://bugs.openjdk.java.net/browse/JDK-8054569 参考:Java8 Lambdas and Exceptions