英文:
vsCode does not show Java intelliSense
问题
我收到了一个新的Amazon Workspaces工作区,并遇到了以下错误:
"无法使用Gradle分发连接运行分阶段构建操作
'https://services.gradle.org/distributions/gradle-6.8-bin.zip'。
Gradle 6.8需要Java 8或更高版本才能运行。您的构建当前
配置为使用Java 7。"
该应用程序可以编译和运行,只是我没有获得智能感知帮助。
当前的Java安装使用:
openjdk 11.0.19 2023-04-18 LTS
OpenJDK Runtime Environment Corretto-11.0.19.7.1 (build 11.0.19+7-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.19.7.1 (build 11.0.19+7-LTS, mixed mode)
build.gradle
文件设置了版本:
sourceCompatibility = '1.11'
targetCompatibility = '1.11'
推荐的Java扩展已安装:Language Support for Java(TM) by Red Hat
我不太确定如何在vsCode中设置Java运行时版本并使其生效。尝试更改设置时,没有设置Java版本(请参见下面的图像)。编辑按钮将我带到设置sourceCompatibility
和targetCompatibility
的build.gradle
文件。
有什么建议吗?
英文:
I received a new Amazon Workspaces workspace and have been running into the following error:
"Could not run phased build action using connection to Gradle distribution
'https://services.gradle.org/distributions/gradle-6.8-bin.zip'.
Gradle 6.8 requires Java 8 or later to run. Your build is currently
configured to use Java 7."
The app compiles and runs fine, I just get no intelliSense help.
Current Java installation uses:
openjdk 11.0.19 2023-04-18 LTS
OpenJDK Runtime Environment Corretto-11.0.19.7.1 (build 11.0.19+7-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.19.7.1 (build 11.0.19+7-LTS, mixed mode)
The build.gradle
file sets the version:
sourceCompatibility = '1.11'
targetCompatibility = '1.11'
The recommended Java extension is installed: Language Support for Java(TM) by Red Hat
I'm not quite sure how to set the java runtime version within vsCode and get it to take. When attempting the change the setting, there is no Java version set (see image below). The edit button takes me to the build.gradle which sets the sourceCompatibility
and targetCompatibility
.
Any suggestions?
答案1
得分: 0
显然,在工作空间上安装了3个版本的Java。找到正确的JVM并设置Gradle守护程序使用它解决了我的所有问题。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论