您的位置:首页 > 博客中心 > 电脑问题 >

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

时间:2022-03-18 07:54

具体报错内容如下:

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.7</java-version>
</properties>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
            <source>${java-version}</source>
            <target>${java-version}</target>
            <encoding>UTF-8</encoding>
        </configuration>
    </plugin>
</plugins>

热门排行

今日推荐

热门手游