文章目录
命令介绍
The java_home command returns a path suitable for setting the JAVA_HOME environment variable. It determines this path from the user’s preferred JVM based on configured environment variables. Additional constraints may be provided to filter the list of JVMs available. By default, if no constraints match the available list of JVMs, the default order is used. The path is printed to standard output.
命令选项说明
-v or --version version
Filters the returned JVMs by version (as if JAVA_VERSION had been set in the environment). Example versions: "11.0", or "14.0.2".
-a or --arch architecture
Filters the returned JVMs by the architecture they support (as if JAVA_ARCH had been set in the environment). Example architectures: "x86_64", or "arm64".
-F or --failfast
Immediately fails when filters return no JVMs; does not print out the path to the default $JAVA_HOME.
--exec command ...
Executes the command at $JAVA_HOME/bin/<command> and passes the remaining arguments. Any arguments to select which $JAVA_HOME to use must precede the --exec option.
-X or --xml
Prints a list of all matching JVMs and associated properties as an XML plist to stdout.
-V or --verbose
Prints a list of all matching JVMs and architectures to stderr.
-h or --help
Brief usage information.
帮助信息
[~]$ man java_home