查看 mac 上安装的所有 java 版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36766028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 18:39:49  来源:igfitidea点击:

See all the java versions installed on mac

java

提问by eureka19

How can I get all the java versions installed on my mac? Is there a terminal command for this?

如何在我的 Mac 上安装所有 Java 版本?有终端命令吗?

When I do java -versionI get the current JRE version that is in use in my system but I want to get the list of all the JREs installed on my mac.

当我执行java -version 时,我获得了系统中正在使用的当前 JRE 版本,但我想获得我的 mac 上安装的所有 JRE 的列表。

采纳答案by Thorbj?rn Ravn Andersen

/usr/libexec/java_home -V

lists one line pr Java environment installed (and known to the /usr/bin/javacommand). You can still have e.g. Zulu installations which are not registered

列出一行已安装的 pr Java 环境(并且该/usr/bin/java命令已知)。您仍然可以拥有未注册的例如 Zulu 安装