You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Java Runtime incorrect, when using gradle toolchains #2804
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
}
java {
toolchain {
languageVersion =JavaLanguageVersion.of(17)
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit test framework.
testImplementation 'junit:junit:4.13'// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:29.0-jre'// Java Parser and Code Generator
implementation 'com.github.javaparser:javaparser-symbol-solver-core:3.24.7'
}
It uses the Java 1.17 toolchain, however in the Configure Java Runtime Tab, it shows Java Version 12:
When I try to use newer Java features, it shows the following Error: The Java feature 'Text Blocks' is only available with source level 15 and above
Currently, toolchain can be used successfully in Eclipse by specifying it as an argument.
Eclipse: Preference > Gradle > Advanced Options > Program Arguments
Activity
jdneo commentedon Nov 17, 2022
Looks like an issue related with eclipse-buildship/buildship#1039
cypher256 commentedon Apr 9, 2024
Currently, toolchain can be used successfully in Eclipse by specifying it as an argument.
Eclipse: Preference > Gradle > Advanced Options > Program Arguments
However, it does not work even if I specify it as an argument to VSCode.