4

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"))
timo
  • 103
  • 2
  • 12

1 Answers1

8

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.

Tal Glik
  • 480
  • 2
  • 11
  • This is my java version 1.7. After changing it to 1.8. It works perfectly fine now. – timo Jun 09 '21 at 03:47