question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Compiler level` and `gradle` project settings are inconsistent

See original GitHub issue

I’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", image

Environment
  • Operating System:Windows11 22H
  • JDK version:19
  • Visual Studio Code version:1.72.2
  • Java extension version:1.12.0
Steps To Reproduce
  1. 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
  1. 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:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mozhuanzuojingcommented, Nov 1, 2022

looks like a bug related to #2764, and this issue has been fixed in the pre-release version. Would you mind switching to pre-release verison (v1.13.2022102804 for now), and clean workspace?

Used the preview version and now it works. thanks!

0reactions
mozhuanzuojingcommented, Nov 1, 2022

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found