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

前端 未结 8 1124
我寻月下人不归
我寻月下人不归 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:32

    I just fixed it as follows:

    Right click the project -> Open Module Settings -> Modules -> Sources -> 8 or higher

    And then

    If still encounter the error and using maven, you have to add the build configuration in your pom.xml:

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

提交回复
热议问题