When I introduced Java with the intention of doing it with the Remote-Containers extension, it suddenly got stuck, so make a note.
If you google with keywords like VSCode Remote Containers Java
, you'll see some articles.
If you refer to, "Remote-Containers: Add Development Container Configuration Files
FromJava (8|11|14)
It is explained as "Choose ~ ~", but when I actually try it, I can't find the Configuration for each version.
As you can see below, there is only Java
, and the rest is Configuration for Azure Function.
If I choose this, I get the JDK 11 .devcontainer
,
This time I wanted to create an 8 system environment, so I was a little troubled.
Predefined Configurations in response to vscode-java now requires Java 11 and above The following PR was done for (the part corresponding to the point that was blocked this time is bolded).
- Removes
java-8
andjava-8-tomcat
- Consolidates
java-11
andjava-14
into one definition with a build arg to pick the version. It usesbuster
as the distro since there's no Oracle one for 11.- Adds args to let people opt into installing their preferred version of Maven or Gradle with just a tweak to
devcontainer.json
- Resolves the issues with cleanup highlighted in #422
- Improves layering so that maven or Gradle can be enabled without having to also re-do the common script
https://github.com/microsoft/vscode-dev-containers/pull/456
"I removed the configuration of java-8
and java-8-tomcat
and integrated the configuration of java-11
and java-14
."
And this has been enabled since v0.131.0.
I think there are the following two ways.
--Install the Remote-Containers extension less than v0.131.0 by version.
--In JDK 11, do your best with the compile options --source
and --target
.
You can change the version with the build argument, as described in 2. above.
It is under devcontainer.json
.
devcontainer.json
"args": {
// Update the VARIANT arg to pick a Java version >= 11
"VARIANT": "11",
//Abbreviation
}