IDEA异常 -- 汇总
[TOC]
Error:java: Compilation failed: internal java compiler error
- 解决办法:
File-->Setting...-->Build,Execution,Deployment-->Compiler-->Java Compiler 设置相应Module的target bytecode version的合适版本(跟你jkd版本一致),这里我改成1.8版本的。
Usage of API documented as @since 1.7+
- 问题原因:
出现该问题的原因是由于使用了JAVA8的新特性,但是Language Level(最低可支持的版本)比较低,无法支持这些特性。比如设置的Language Level为6.0,可是却使用了8.0/9.0的新特性,6.0无法解析这些特性,因此IDE会报错来提醒我们 - 解决办法:
1)打开Project Structure,选中侧边栏的Modules,在Sources窗口中修改Language Level(必须大于等于报错信息给出的level)。改动后,IDE错误消失。
2)如果不在pom.xml中进行配置,则默认将Module的Language Level设置为5。所以要在pom.xml文件中添加插件进行配置。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
IDEA报错Cannot download sources解决方法
idea maven项目,pom中依赖下载不下来
心如止水,虚怀如谷