如何从命令行查找有关 OpenJDK 提供程序的详细信息



OpenJDK有许多提供商,即亚马逊 - Corretto,Azul,IBM,Oracle,RedHat等。

OpenJDK是随我的操作系统一起安装的。所以,我对我的OpenJDK提供商一无所知。

当我查询版本时,它显示 -

blueray@blueray-i58600K:~$ java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

如何确认我的 OpenJDK 提供程序的身份?

命令行中键入jshell

在 REPL 中复制并粘贴以下行 -

System.out.println("java Vendor URL : "+System.getProperty("java.vendor.url"));
System.out.println("java Vendor : "+System.getProperty("java.vendor"));
System.out.println("java Version : "+System.getProperty("java.version"));
System.out.println("Java Runtime Name : "+System.getProperty("java.runtime.name"));
System.out.println("Java Runtime Version : "+System.getProperty("java.runtime.version"));
System.out.println("Java Runtime Version : "+Runtime.version());
System.out.println("Java Virtual Machine Specification Name : "+System.getProperty("java.vm.specification.name"));
System.out.println("Java Virtual Machine Specification Version  : "+System.getProperty("java.vm.specification.version")); 
System.out.println("Java Virtual Machine Specification Vendor : "+System.getProperty("java.vm.specification.vendor"));
System.out.println("Java Virtual Machine Implementation Name : "+System.getProperty("java.vm.name"));
System.out.println("Java Virtual Machine Implementation Version : "+System.getProperty("java.vm.version"));
System.out.println("Java Virtual Machine Implementation Vendor : "+System.getProperty("java.vm.vendor"));

回车键

引用

我正在使用哪个 JRE

如何知道我使用的是 Open JDK 还是 Oracle JDK?

如何打印出所有系统变量,例如java.class.path

如何从程序中找到JVM版本?

平台环境>基础课程

道歉和免责声明:我很抱歉,因为我确定我错过了一些参考资料。

相关内容

最新更新