Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler level and gradle project settings are inconsistent #2770

Closed
mozhuanzuojing opened this issue Nov 1, 2022 · 5 comments
Closed

Compiler level and gradle project settings are inconsistent #2770

mozhuanzuojing opened this issue Nov 1, 2022 · 5 comments
Labels
need verify The fix is available, need verify from user

Comments

@mozhuanzuojing
Copy link

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.

@CsCherrYY
Copy link
Contributor

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?

@jdneo jdneo added the need verify The fix is available, need verify from user label Nov 1, 2022
@jdneo
Copy link
Collaborator

jdneo commented Nov 1, 2022

Could you try the suggestion that @CsCherrYY provided and let us know if this fixes your problem?

@mozhuanzuojing
Copy link
Author

Could you try the suggestion that @CsCherrYY provided and let us know if this fixes your problem?

sorry, replay late. i test it . it's ok. everything is normal now !

@mozhuanzuojing
Copy link
Author

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!

@mozhuanzuojing
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need verify The fix is available, need verify from user
Projects
None yet
Development

No branches or pull requests

3 participants