intellij 出现“Usage of API documented as @since 1.6+”的解决办法

2018-01-17 16:42:59

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

 

File ->Project Structure->Project Settings -> Modules -> 你的Module名字 -> Sources -> Language Level->选个默认的就行。



1、error 1:Intellij Error:usage of api documented as @since 1.6+

错误场景:

开发工具:Intellij

在使用最新的Java8库的时候(我用的是Date.toInstant() ),在调用该方法的地方会有错误提示:

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

问题解决:

    查阅资料发现这可能是其他项目的设置影响了编译器的等级。当编译器发现源代码和目标Java版本与设置的编译版本不同时,便会报这个错误。

    要解决该问题,需作如下配置:Flie -> Project Structure -> Project Settings -> Modules -> "Your Module Name" -> Sources ->Language Level ,然后将其更改为所需级别,即8或"项目默认语言级别"。


2、error 2: Error:java: Compilation failed: internal java compiler error


问题解决:按照方法1修改语言级别后,Maven-->Reimport, 再次编译,问题会还原,所以这样不能根本解决问题。

需要做的是在Maven依赖配置文件pom.xml中添加complier插件,并且指定版本,就不会再报错了:

[java] view plain copy

  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>  


  • 2021-01-21 13:52:36

    node.js使用Nodemailer发送邮件

    常常看到一些网站有邮箱获取验证码验证注册或者修改密码等,今天也来了解一下在nodejs + express怎么发送电子邮件。使用模块Nodemailer。这里以qq邮箱举例子。

  • 2021-01-21 13:55:53

    Mongodb字段更新$unset操作符

    当使用$操作符匹配任何数组元素,$unset替换指定的元素为null而不是删除掉指定的元素,此行为保持数组大小和位置一直;

  • 2021-01-22 08:30:02

    Android IO简化之Okio库

    如果之前有使用过Okhttp,那么你一定知道底层的IO读取是由square公司开发的Okio库。它补充了Java.io和java.nio的不足,以便能够更加方便,快速的访问、存储和处理你的数据。而在一般的开发中,我们也可以使用Okio来做IO读写,非常方便深得我心

  • 2021-01-22 21:56:48

    emcc生成wasm,wast,bc文件的方法

    Emscripten实现把C/C++文件转成wasm,wast(wasm的可读形式),llvm字节码(bc格式),ll格式(llvm字节码的可读形式)的步骤。

  • 2021-01-22 21:59:34

    emcc编译与部分重要参数选取

    C/C++代码通过emcc编译为字节码,然后根据不同的目标编译为asm.js或wasm。emcc和gcc编译选项类似,例如-s OPTIONS=VALUE、-O等。另外为了适应Web环境,emcc增加了一些特有的选项,如–pre-js 、–post-js 等。

  • 2021-01-22 22:01:19

    Emscripten Compiler Frontend (emcc)

    The Emscripten Compiler Frontend (emcc) is used to call the Emscripten compiler from the command line. It is effectively a drop-in replacement for a standard compiler like gcc or clang.

  • 2021-01-22 22:21:41

    emcc编译命令介绍

    这个输入文件file,既可以是clang可以编译的C/C++语言,也可以是二进制形式的llvm bitcode或者人类可读形式的llvm assembly文件。