[英]IntelliJ Using Wrong JDK - Execution failed for task ':compileJava'. > invalid source release: 11
My project runs on the command line but fails to run in IntelliJ.我的项目在命令行上运行,但无法在 IntelliJ 中运行。 I've tried all of the solutions in the following questions:我已经尝试了以下问题中的所有解决方案:
Does anyone know why InteliJ is not using the JDK I defined?有谁知道为什么 InteliJ 不使用我定义的 JDK?
Finally, this worked for me:最后,这对我有用:
sdk default java 11.0.11.9.1-amzn
在命令行上,运行sdk default java 11.0.11.9.1-amzn
I'm still interested to know how to override the SDKMAN setting within IntelliJ.我仍然很想知道如何覆盖 IntelliJ 中的 SDKMAN 设置。 If anyone knows, please adda comment or answer.如果有人知道,请添加评论或回答。 Thanks!谢谢!
USE SDKMAN to install the java versions.使用 SDKMAN 安装 java 版本。 configure the installed sdks into IntelliJ and use the appropriate one for the project将已安装的 sdks 配置到 IntelliJ 中并为项目使用合适的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.