博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
(转)“Usage of API documented as @since 1.8+”报错的解决办法
阅读量:4280 次
发布时间:2019-05-27

本文共 1199 字,大约阅读时间需要 3 分钟。

【转载原因:解决问题】

【转载原文:】

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/a499477783/article/details/78967586
收起
出现如图错误: 

报错信息: 

Usage of API documented as @since 1.8+ 
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.

问题原因:

出现该问题的原因是由于使用了JAVA8的新特性,但是Language Level(最低可支持的版本)比较低,无法支持这些特性。比如设置的Language Level为6.0,可是却使用了8.0/9.0的新特性,6.0无法解析这些特性,因此IDE会报错来提醒我们。

解决方法:

如果对最低支持版本有要求,没办法改动的话,那就只能放弃使用报错部分的代码。 

如果对支持版本没有要求的话,可以改动IDE的Language Level来消除错误。

使用ctrl+shift+alt+S,打开Project Structure,选中侧边栏的Modules,在Sources窗口中修改Language Level(必须大于等于报错信息给出的level)。改动后,IDE错误消失。 

Maven项目每个Module都有单独的pom.xml,如果不在pom.xml中进行配置,则默认将Module的Language Level设置为5。所以要在pom.xml文件中添加插件进行配置。

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

 

你可能感兴趣的文章
DVB-S相关术语说明
查看>>
什麼是DiSEqC
查看>>
GNOME frontend for the rdesktop client
查看>>
sata3 devices如何偵測
查看>>
備份硬碟 (include system)
查看>>
MPEG-2 学习笔记(轉載)
查看>>
repo & git 的使用方法
查看>>
repo & git 的使用方法
查看>>
Git 練習與基本操作
查看>>
git教學好網站
查看>>
保護你的隱私,從 PGP 開始!
查看>>
保護你的隱私,從 PGP 開始!
查看>>
What does “%.*s” mean in printf?
查看>>
The Linux Kernel Module Programming Guide(hello)
查看>>
makefile的三個特殊符號(= := ?=)
查看>>
HowTo: Linux Check IDE / SATA Hard Disk Transfer Speed
查看>>
Use a variable reference “inside” another variable
查看>>
route table使用傳統指令修改方法(非iproute2)
查看>>
How to pad a file with “FF” using dd?
查看>>
ubiformat and nandwrite
查看>>