Skip to content

Java

Curated name java. Installs a JDK via the upstream devcontainers/features/java feature. Monoceros turns on Maven and Gradle by default (the upstream feature ships only the JDK), so a plain languages: [java] is build-ready out of the box.

Terminal window
monoceros init acme --with-languages=java
monoceros add-language acme java:21

Either writes the object form into the yml, with the version and the Maven/Gradle toggles inline and editable:

languages:
- java:
version: latest
installMaven: true
installGradle: true
Terminal window
monoceros remove-language acme java

Or delete the entry from acme.yml by hand and re-run monoceros apply acme - the yml is the source of truth.

Pin a JDK major with the :version suffix; it lands in the version key above.

Terminal window
monoceros add-language acme java:21

Supported JDK majors: 21, 17, 11, 8 (also latest).

version, installMaven and installGradle are surfaced in the yml - edit them in place (e.g. set installMaven: false), then monoceros apply. Other options are set by adding the feature directly (see Other feature options):

OptionDefaultWhere to set
versionlatestyml (:version suffix or the version key)
installMaventrue (Monoceros default; upstream false)yml
installGradletrue (Monoceros default; upstream false)yml
jdkDistromsadd-feature (ms, open, oracle, tem, amzn)
mavenVersion / gradleVersionlatestadd-feature

Full option list: upstream feature.