-
Notifications
You must be signed in to change notification settings - Fork 455
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
Global JDK Management Capability Support #3954
Comments
Have you tried https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack ? It should have a way to nicely configure your project JDK : https://code.visualstudio.com/docs/java/java-project#_configure-runtime-for-projects . If you have a managed project (eg. Maven, Gradle, Eclipse-based). then the build files (pom.xml, build.gradle, .classpath, etc) will specify what the supported compile/runtime is. vscode-java will scan your system, and attempt to find a compatible version. You can modify this using the setting If by "extension" you mean contributions to VS Code like "vscode-java", then you shouldn't have to worry about their runtime. The extension provides its own JRE on most platforms. There is an option to override that ( |
I've used this configuration, but for some unknown reason it doesn't take effect in VSCode. In short, when developing with VSCode for Java, the choice of JDK is very unclear. I don't understand why everything is configured through settings.json instead of providing a UI for developers to select from. Isn't a UI experience much better? Who would know how to configure the JDK information without reading the documentation? Moreover, every developer's local environment is different and they all have to configure their JDK paths. Why can't it be like JetBrains, where you can download a JDK from their own marketplace? That way, at least the usage of the downloaded JDK would be unified. I've spent a long time configuring the JDK for Java development in VSCode, and it still doesn't work well. For example, the JDK used by the extension at runtime does not match the one used in my project. Even when I configure my project's JDK as the extension requires, it still doesn't take effect in the terminal. I can't figure out why. Currently, the barrier to entry is too high. There are too many hidden details that require developers to be very familiar with the extension's configuration. It takes a long time to sort out all these configuration relationships. |
Like when using JetBrains IDEA, the IDE provides the ability to manage JDKs globally, which allows developers to specify a uniform JDK version based on the set global JDKs regardless of what JetBrains plugin they are using, but in VSCode, each feature is supported as an extension, and each extension doesn't have a uniformly managed JDKs This is a headache for developers. Each extension has to set a JDK path, and there is no entry point that can be globally referenced. I'm not even sure what version of the JDK the extension is working with, and what version of the JDK is being used to compile the project. It's very confusing.
The text was updated successfully, but these errors were encountered: