Skip to content

JDK on PATH environment variable is not detected #1391

Open

Description

@soloturn

Environment:

  • VS Code Version:
  • Extension Version: v0.29.0
  • JDK Type & Version: OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)
Version: 1.94.2 (user setup)
Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427
Date: 2024-10-09T16:08:44.566Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT arm64 10.0.26100

Step to Reproduce:

  • install openjdk and put it on the path
  • do NOT set JAVA_HOME
  • start vscode, install extension

Expected Behavior:

  • extension installs and works

Actual Behavior:

  • complains about missing java

Activity

  1. jdneo commented on Oct 14, 2024

    @jdneo
    Member

    Have you tried set the JDK to the setting java.configuration.runtimes? See: https://github.com/redhat-developer/vscode-java?tab=readme-ov-file#project-jdks

  2. soloturn commented on Oct 14, 2024

    @soloturn
    Author

    Sheng Chen (@jdneo) yes, i can get it work by setting such a variable. but it would be really nice if the vscode java pack is more intelligent here (or less) and relies on PATH only.

  3. changed the title [-]java is on the path, extension does not recognize it[/-] [+]JDK on PATH environment variable is not detected[/+] on Oct 15, 2024
  4. github-actions commented on Nov 4, 2025

    @github-actions

    Hi soloturn, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    Suggestions

    • Verify java is on your PATH:
      1. Open a new Command Prompt or PowerShell.
      2. Run java -version. If you see an error, your PATH isn’t picking up the JDK.
    • After changing system or user PATH, restart VS Code (or your machine) so it picks up the updated environment.
    • Launch VS Code from a shell that has the correct PATH (e.g. code .) to ensure it inherits your variables.
    • Explicitly configure the JDK in VS Code settings rather than relying on PATH:
      // settings.json
      {
        "java.home": "C:\\Program Files\\OpenJDK\\jdk-21"
      }
    • (Optional) Set a JAVA_HOME environment variable pointing to the JDK root (not the bin folder), then restart VS Code.

    References with high confidence

    Other references with low confidence

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions