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

The javaToolchains in the activity bar and the javaToolchains in the terminal(CMD) within vscode are different. #1602

Open
itcasim0 opened this issue Sep 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@itcasim0
Copy link

itcasim0 commented Sep 5, 2024

Extension Name: vscode-gradle
Extension Version:3.16.4
OS Version:Windows 11
VSCode version:1.92.2

Describe the bug
The javaToolchains in the activity bar and the javaToolchains in terminal(CMD) within vscode are different.

To Reproduce
Steps to reproduce the behavior.
If you go to help > javaToolchains > Run Task in the activity bar, only jdk-17 is detected.

When you run the below command in terminal(CMD), jdk-8 is also detected.

gradlew javaToolchains

Jdk-8 is registered in the Path of the system environment variable.
And jdk-17 is not registered at all, but is located in the path of C:\Program Files\Java\jdk-17.

Jdk-8 is detected only when java.import.gradle.java.home is specified in setting.json in vscode.

Expected behavior
Jdk paths should be detected.

Screenshots

  • Run in the activity bar
    image
    image

  • Run in the terminal(CMD)
    image

Output from "Gradle for Java"
image

Does the bug still exist if you disable all other extensions?
Yes/No

Additional context
It is very inconvenient to specify java.import.gradle.java.home for each project every time.
So, I want to know the mechanism by which gradle detects jdk in activity bar.

@itcasim0 itcasim0 added the bug Something isn't working label Sep 5, 2024
@jdneo
Copy link
Member

jdneo commented Sep 5, 2024

What if you close all vscode windows. And launch it via code . from your CMD. In that case, will jdk 8 be detected?

@itcasim0
Copy link
Author

itcasim0 commented Sep 5, 2024

Is this what you want to know?
image

@jdneo
Copy link
Member

jdneo commented Sep 5, 2024

Still cannot detect jdk8 from task explorer?

@itcasim0
Copy link
Author

itcasim0 commented Sep 5, 2024

yes, still cannot detect jdk8

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants