我是 windows 本地用户,从未使用过 linux/unix 或除 windows 以外的任何其他操作系统。最近我切换到 Mac。 我在我的 mac 机器上安装了 java 8。我也以某种方式设置了我的 JAVA_HOME 变量。我不得不努力找出它的存储位置。在互联网上进行研究后,我在终端上使用以下命令找出我的 java 的安装位置并提供了正确的路径。
/usr/libexec/java_home
我很想知道,这个命令是什么意思?
最佳答案
打开一个终端窗口。类型
man java_home
您将获得:
java_home(1) java_home(1)
NAME java_home - return a value for $JAVA_HOME
SYNOPSIS /usr/libexec/java_home [options]
DESCRIPTION The java_home command returns a path suitable for setting the JAVA_HOME environment variable. It determines this path from the user's enabled and preferred JVMs in the Java Preferences application. 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.
关于macos -/usr/libexec/java_home 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41931493/