2

I'm trying to build junit 5 from source via gradle (OS X, el kapitan) checked out: git clone https://github.com/junit-team/junit5.git

running command to build: gradlew clean assemble (or install)

in both cases i get:

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

any hints? thx in advance

rome
  • 476
  • 1
  • 9
  • 19
  • 2
    What version of javac are you using? I just tried it with 1.8.0_131 and did not have any trouble. – Dump Cake Sep 12 '17 at 20:32
  • java version "1.8.0_40" Java(TM) SE Runtime Environment (build 1.8.0_40-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode) – rome Sep 15 '17 at 13:56

1 Answers1

2

This is a result of a JDK bug that was corrected in a release at some point after 1.8_40. Try upgrading your JDK to the latest version.

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

Dump Cake
  • 250
  • 2
  • 8