microsoft / microsoft/vscode-java-pack

Bug: Gradle build error: Supplied javaHome is not a valid folder. You supplied: /usr/local/sdkman/candidates/java/current

Open
#1,405 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged bug
Dominant language
TypeScript
Stars
352
Forks
166
Avg merge
17h 47m
Merged PRs (30d)
32

Description

Environment:

  • VS Code Version: 1.97.2
  • Extension Version: 3.16.4
  • JDK Type & Version: temurin, 21
  • OS Type & Version: Linux

Step to Reproduce:

Use devcontainer (GitHub Codespaces)

{
    "image": "mcr.microsoft.com/devcontainers/java:21"
}

with a Gradle project

For example use this project: https://github.com/hfhbd/mavencentral and open it with GitHub Codespaces

Expected Behavior:
No issue when opening the Gradle project

Actual Behavior:

[info] [gradle-server] Gradle Server started, listening on 38591
[info] Gradle client connected to server
[info] [gradle-server] Downloading https://services.gradle.org/distributions/gradle-8.13-milestone-3-bin.zip
[info] [gradle-server] ...
[info] [gradle-server] ....
[info] [gradle-server] ..
[info] [gradle-server] ...
[info] Java Home: /usr/local/sdkman/candidates/java/current
[info] JVM Args: -Xmx2048m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant
[info] Gradle User Home: /home/vscode/.gradle
[info] Gradle Version: 8.13-milestone-3
[error] Error getting build for /workspaces/mavencentral: Supplied javaHome is not a valid folder. You supplied: /usr/local/sdkman/candidates/java/current
Image

Related Issues:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided Java 21 devcontainer and the linked mavencentral Gradle project in GitHub Codespaces. Start from the Gradle server log and trace how /usr/local/sdkman/candidates/java/current is selected; done means the project opens without the invalid javaHome error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.