Intellij - Unable to use newer Java 8 classes - Error : “Usage of API documented as @since 1.6+..”

前端 未结 8 1176
我寻月下人不归
我寻月下人不归 2020-11-28 19:00

I\'m trying to use a java.lang.function.Function in my java 8 code base, but i keep getting the following error in Intellij.

Usage of API

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 19:08

    File > Settings > Build, Execution, Deployment > Java Compiler

    Change Target bytecode version to 1.8 of the module that you are working for.

    If you are using Maven

    Add the compiler plugin to pom.xml under the top-level project node:

    
            
                
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    
                        1.8
                        1.8
                    
                
            
        

提交回复
热议问题