`Compiler level` and `gradle` project settings are inconsistent
See original GitHub issueI’m using a gradle project, and the gradle compiled source code level is JDK19,
java {
toolchain {
languageVersion = JavaLanguageVersion.of(19)
vendor = JvmVendorSpec.ADOPTIUM
}
}
but the actual compilation level is JDK1.8.
After my check, I found that JDK1.8 is derived from "java.settings.url": "file:///C:/Users/Administrator/AppData/Roaming/Code/User/org.eclipse.jdt.core.prefs",
Environment
- Operating System:Windows11 22H
- JDK version:19
- Visual Studio Code version:1.72.2
- Java extension version:1.12.0
Steps To Reproduce
- set
"java.settings.url
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
- set gradle project source level
java {
toolchain {
languageVersion = JavaLanguageVersion.of(19)
vendor = JvmVendorSpec.ADOPTIUM
}
}
Current Result
java source level = jdk1.8
Expected Result
java source level = jdk19
Additional Informations
If I change the configuration java.settings.url
to JDK19, the source code level is 19.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Android Studio Build Error : This version of ... - Stack Overflow
Gradle version error has disappeared. But now I have this error when I try to run my project: Error running app: This version...
Read more >Sub-projects are ignored? - Gradle Forums
Problem is that they aren't. The sub-projects are not being built when running the build.gradle in the parent project. It appears that Gradle...
Read more >Known issues with Android Studio and Android Gradle Plugin
To fix the issue for all future projects, click File > Close Project. You should see the welcome screen. Then click Configure >...
Read more >Deprecated Gradle features were used in this build, making it ...
My project is ejected from Expo. An update on my issue, I added org.gradle.java.home in gradle.properties to point to my correct ...
Read more >Solved: Java compiler level does not match the version of the ...
To solve this issue, you need to make one time update in your pom.xml file. This update is for overriding the default compiler...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Used the preview version and now it works. thanks!