sta*_*per 10 java intellij-idea java-11
我设置了JDK 11,它编译直到我使用isBlank()String 的Java 11的新方法,当我使用该方法编译时出现此错误,我尝试清理JDK安装,从IntelliJ清除缓存,重建但没有任何帮助.错误是:
cac*_*co3 14
尝试将编译器目标字节码版本设置为11。
去Settings- Build, Execution, Deployment- Compiler- Java compiler并设置目标字节代码的版本你的模块 11
Ros*_*sny 12
你应该检查以下事项:
如果您使用Maven,请检查您的编译器插件"source"和"target"属性pom.xml是否为11. pom.xml在这种情况下,您的模块语言级别配置是从该配置导入的
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
Run Code Online (Sandbox Code Playgroud)
要么
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
如果您的pom.xml源或目标级别错误,您可能需要执行右键单击| Maven | 改变之后重新进口pom.xml.如果您使用Gradle,则应检查您是否具有类似的配置.
在IntelliJ IDEA 2018.2.4中使用Maven 3.5.4进行测试
我有类似的问题。找不到Java 11 功能的符号。尽管一切都已经设置为 11 点了。
解决方案是在我的Idea设置中将Gradle JVM设置为JDK 8。(因为我后来添加了JDK 11)
当我的 build.gradle 中未设置sourceCompatibilty时targetCompatibility,gradle 守护进程(从 Idea 启动)正在使用 JDK 8 运行和编译。这些属性动态设置为 8(或 1.8)。
我的解决方案是告诉 Idea 将 Gradle 的 JVM 设置为 11:
| 归档时间: |
|
| 查看次数: |
6940 次 |
| 最近记录: |