如何判断 Java 是 Sun / Oracle / OpenJDK?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10900579/
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-09-19 00:52:57  来源:igfitidea点击:

How can I tell whether Java is Sun / Oracle / OpenJDK?

javaoracleopenjdksun

提问by Daniel Standage

Possible Duplicate:
Which JRE I am using

可能的重复:
我使用的是哪个 JRE

I'm trying to figure out whether the Java installation in my HPC environment is running the Sun JVM, or Oracle, or OpenJDK. Since I don't have administrator access and I didn't install Java, is there a quick way I can determine which JVM I have installed?

我试图弄清楚我的 HPC 环境中的 Java 安装是运行 Sun JVM、Oracle 还是 OpenJDK。由于我没有管理员访问权限并且我没有安装 Java,有没有一种快速的方法可以确定我安装了哪个 JVM?

standage@login4:~$ which java
/usr/bin/java
standage@login4:~$ java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)
standage@login4:~$ uname
Linux

采纳答案by Will Hartung

There's a java.vendorproperty from System.getProperties(), that should give you the info that you're looking for.

java.vendorSystem.getProperties() 中有一个属性,它应该为您提供您正在寻找的信息。

On my Mac it's:

在我的 Mac 上是:

java.vendor=Apple Inc.