-
Notifications
You must be signed in to change notification settings - Fork 51
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
VSCode java home not being used #249
Comments
Hi. Thanks for the report. Yes this extension does not read any of the settings that are defined by the vscode-java extension. (Full list of settings here.) Instead this extension uses a more standard approach of defining per-project java settings, that can be defined in I understand the confusion the |
Hi. Personally I think it makes sense to use For the As for the environment variables, it works, but feels more like an workaround than an actual solution. |
Hey thanks for responding. I agree with your first point. For the second point, yes the point of About the environment variables, I feel this is the most consistent & standard way of configuring things. Developers will already be aware of these standard variables. Maybe it's not obvious to some how to change those variables on a per-project basis, but that's outside the scope of this extension. But saying all of that, I think consistency is more important here. So if the You've basically convinced me to a least support |
That's great! I think it will simplify some of the initial work of setting up projects. Thanks for the help, and the extension! |
Cool 👍 Thanks for the feedback. Some initial ideas about providing support for this setting: Similar to I'm unsure if i also need to specify this setting on the gradle ModelBuilder but if so I will need to either create a new argument for the server or read from custom ENV var as above, and make that value accessible so the handlers can read it. |
Add support for custom java home setting. Refs #249
I've got a working solution with #255 I've not being able to write tests for this (testing vscode extensions are hard) but I have verified it's working as expected by looking at the spawned java processes. (Also sorry for the delay, due to the corona virus and various other reasons, it took me a long time to setup a windows VM to test the changes to the windows I will release shortly so you can test this. |
@skypartan this feature is now released with version 2.5.0 can you update the extension and see if this works for you? i've added a note about this setting to the README here: https://github.com/badsyntax/vscode-gradle#extension-settings |
Hey! I did a quick test here and it looks like it's working without errors, my tasks were executed with the jdk defined in |
Good to hear, thanks! |
Extension Name: vscode-gradle
Extension Version: 2.4.13
OS Version: Windows 1909
VSCode version: 1.43.2
Describe the bug
The extension doesn't use the java environment set in the workspace settings, instead it defaults to gradle search method, which uses the default system installation.
To Reproduce
Have a system with multiple versions of java (8 and 11 in my pc)
Configure one of them as the default (JAVA_HOME or System Path)
Configure vscode to use the other version with "java.home" setting (provided by Java extension from Red Hat)
Expected behavior
All Gradle tasks should be executed with the java version configured in the vscode "java.home" setting.
Does the bug still exist if you disable all other extensions?
Yes
The text was updated successfully, but these errors were encountered: