Intellij IDEA 出现"Usage of API documented as @since 1.6+"的解决办法

2021-02-16 08:20

阅读:465

具体报错内容如下:

This inspection finds all usages of methods that have @since tag in their documentation.  This may be useful when development is performed under newer SDK version as the target platform for production

报错图:

技术分享图片

看代码意思是,那个方法是自Java1.6开始的,但是,你的language level 才是5,级别不够,所以,就报错了。

根本的解决办法是在maven中设置编译级别

properties>
    java-version>1.7java-version>
properties>
plugins>
    plugin>
        groupId>org.apache.maven.pluginsgroupId>
        artifactId>maven-compiler-pluginartifactId>
        version>3.2version>
        configuration>
            source>${java-version}source>
            target>${java-version}target>
            encoding>UTF-8encoding>
        configuration>
    plugin>
plugins>


评论


亲,登录后才可以留言!