timo
timo

Reputation: 113

Cannot access java.util.function.Predicate

I use swagger to generate code for spring server and try to run with intelliJ. However I got the following error message. Any help is appreciated.

java: cannot access java.util.function.Predicate
  class file for java.util.function.Predicate not found

on the line

.apis(RequestHandlerSelectors.basePackage("io.swagger.api"))

Upvotes: 5

Views: 6049

Answers (1)

Tal Glik
Tal Glik

Reputation: 510

You are probably using java version lower then java 8. Please verify in your POM file:

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>  

And also in the ide you are using java 8 or above.

Upvotes: 10

Related Questions