Idea中提示错误信息:Usage of API documented as @since 1.6+ less...

最近在Idea中遇到这么一个错误提示信息:

Usage of API documented as @since 1.6+ less... (Ctrl+F1)

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.

Idea中提示错误信息:Usage of API documented as @since 1.6+ less..._第1张图片

原因:意思是说明我们的项目配置的language level不够,去修改下就可以了

解决:打开Project Structure --》 Modules --》 Language Level 选择高版本的即可

Idea中提示错误信息:Usage of API documented as @since 1.6+ less..._第2张图片

 

如果idea的编译器提示错误消失,启动项目代码后发现此错误:

Information:Using javac 1.8.0_40 to compile java sources
Information:java: javacTask: 源发行版 1.8 需要目标发行版 1.8
Information:java: Errors occurred while compiling module 'provider'
Information:Module "provider" was fully rebuilt due to project configuration/dependencies changes
Information:2019/7/18 11:43 - Compilation completed with 1 error and 0 warnings in 2s 109ms
Error:java: Compilation failed: internal java compiler error

Idea中提示错误信息:Usage of API documented as @since 1.6+ less..._第3张图片

一般需要核查三个地方是否一致,我这里用的jdk版本是1.8,需要核查以下三个地方:

1,第一个就是上面所提到的Language Level

2,第二个是

Idea中提示错误信息:Usage of API documented as @since 1.6+ less..._第4张图片

3,第三个是

Idea中提示错误信息:Usage of API documented as @since 1.6+ less..._第5张图片

保持都一致,就解决了该问题。

 

 

你可能感兴趣的:(IDEA)