[DOCKER] Starting with VSCode's Remote-Containers Extension v0.131.0, there is only one Java Configuration to choose from.

When I introduced Java with the intention of doing it with the Remote-Containers extension, it suddenly got stuck, so make a note.

Clogged point

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 FilesFromJava (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.

スクリーンショット 2020-08-15 0.39.59.png

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.

Reason

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).

  1. Removes java-8 and java-8-tomcat
  2. Consolidates java-11 and java-14 into one definition with a build arg to pick the version. It uses buster as the distro since there's no Oracle one for 11.
  3. Adds args to let people opt into installing their preferred version of Maven or Gradle with just a tweak to devcontainer.json
  4. Resolves the issues with cleanup highlighted in #422
  5. 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.

If you manage to do less than 11

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.

11 or more

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
		}

Recommended Posts

Starting with VSCode's Remote-Containers Extension v0.131.0, there is only one Java Configuration to choose from.
[Java] Platforms to choose from for Java development starting now (2020)
[Java] From two Lists to one array list
[Java] Create a collection with only one element