Intellij IDEA 出现“Usage of API documented as @since 1.7+”的解决办法

具体报错内容如下:

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

报错图:

Intellij IDEA 出现“Usage of API documented as @since 1.7+”的解决办法


解决方案:

Intellij IDEA 出现“Usage of API documented as @since 1.7+”的解决办法


看代码意思是,那个方法是自Java1.7开始的,但是,看我图上面的language level 才是5,级别不够,所以,就报错了。在这个编辑器里面有好 几个地方都有关于这个jdk的版本的设置。


这么改完之后,乍一看好像没问题了,但是,一会问题就又出来啦,还得如下,在maven build 里面添加如下的插件,设置一下Java的版本就好啦。

  1. <build>    
  2.     <plugins>    
  3.         <plugin>    
  4.             <groupId>org.apache.maven.plugins</groupId>    
  5.             <artifactId>maven-compiler-plugin</artifactId>    
  6.             <version>3.6.0</version>    
  7.             <configuration>    
  8.                 <source>1.8</source>    
  9.                 <target>1.8</target>    
  10.             </configuration>    
  11.         </plugin>    
  12.     </plugins>    
  13. </build>