spring – 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"))