如何从命令行查找有关OpenJDK Provider的详细信息

问题描述 投票:2回答:1

有许多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提供商的身份?

java bash
1个回答
0
投票

在命令行键入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"));

按Enter键

参考

Which JRE I am using

How to know if I am using Open JDK or Oracle JDK?

How to printout all the system variables , for example java.class.path

How to find the JVM version from a program?

Essential Classes > The Platform Environment

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

© www.soinside.com 2019 - 2024. All rights reserved.