Closed dashorst closed 1 year ago
I had the same issue with java 11, added the following to .devcontainer.json
to fix it.
"containerEnv": {
"JAVA_HOME": "/usr/lib/jvm/msopenjdk-current"
}
It seems JAVA_HOME
is still correctly set in the following container image tags: 0.205.4-${VARIANT}
. If you change your Dockerfile
in the following way it should work properly again:
-FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
+FROM mcr.microsoft.com/vscode/devcontainers/java:0.205.4-${VARIANT}
Just adding the manual JAVA_HOME
env variable was not enough for me since VS Code could not communicate with the Gradle server properly.
@joshspicer since you are the one who last touched containers/java/definition-manifest.json
can you help to get this fixed or find the right person who can fix this?
It looks like this is an issue with the updated image in its new home at https://github.com/devcontainers/images.
Copied this issue to the new location. Closing here as a dupe - though this does look like a bug.
New issue is https://github.com/devcontainers/images/issues/158
The devcontainer.json points to this URL: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/java
The Dockerfile points to this parent container:
Steps to Reproduce:
JAVA_HOME points to this:
However when I run java --version:
And look where it gets its cup of Java from:
This says to me that the configuration of the Java image is not correct.
Literally a week ago this worked without any problems.