Closed Carson-yy closed 3 weeks ago
It depends what kind of build tool your project uses. A quick look shows the following for Maven & Gradle :
https://www.baeldung.com/maven-java-version https://docs.gradle.org/current/userguide/building_java_projects.html#sec:compiling_with_release
These would be set in your project configuration files, and vscode-java would respect those settings, assuming you had a compatible JDK on the local system.
For unmanaged projects, you could use the java.configuration.runtimes
setting to target a particular Java version :
"java.configuration.runtimes": [
{
"name": "JavaSE-11",
"path": "/usr/lib/jvm/java-11-opendjk/",
"default": true
}
],
...
...
(the "default": true
would apply to the unmanaged project)
It depends what kind of build tool your project uses. A quick look shows the following for Maven & Gradle :
https://www.baeldung.com/maven-java-version https://docs.gradle.org/current/userguide/building_java_projects.html#sec:compiling_with_release
These would be set in your project configuration files, and vscode-java would respect those settings, assuming you had a compatible JDK on the local system.
For unmanaged projects, you could use the setting to target a particular Java version :
java.configuration.runtimes
"java.configuration.runtimes": [ { "name": "JavaSE-11", "path": "/usr/lib/jvm/java-11-opendjk/", "default": true } ], ... ...
(the would apply to the unmanaged project)
"default": true
OK,Thanks
How can the above settings be configured to be enabled by default for all projects?