The cjdk command-line interface is organized into subcommands. A list of
available subcommands and common options can be displayed using the --help
option.
.. versionadded:: 0.2.0
``--index-url``, ``--index-ttl``, ``--os``, and ``--arch``
More details about the choices and defaults for VENDOR,
VERSION, and --cache_dir are available on
separate pages.
All subcommands return 0 on success, 1 on general/unknown errors, 2 on
configuration error (e.g., invalid arguments), 3 if a matching JDK is not
available, 4 if download or unpacking fails. However, the exec subcommand, if
successful, returns the exit code of the launched program.
.. versionchanged:: 0.5.0
Specific exit codes were added.
.. versionadded:: 0.4.0
.. versionadded:: 0.4.0
For example, run the java command from the Temurin JRE 17.0.3 with the
-version option, installing the JRE if necessary:
For example, to print the Java home directory for the Temurin JRE 17.0.3, installing it if necessary:
$ cjdk --jdk temurin-jre:17.0.3 java-home
/Users/mark/Library/Caches/cjdk/v0/jdks/0f77e52f812d326e1137d7a22b81d6c328679c68/jdk-17.0.3+7-jre/Contents/Home
(The output will depend on your operating system and configuration; the example shown was on macOS.)
.. versionchanged:: 0.4.0
Renamed from ``cache-jdk``.
.. versionadded:: 0.2.0
.. versionadded:: 0.2.0
.. versionadded:: 0.5.0