Getting the vendor of the used JRE since Java 9

Viewed 61

Until 8, it was possible to get some information on the vendor of the used JRE as follows:

String vendor = Runtime.class.getPackage().getImplementationVendor().

Since Java 9 and the introduction of the Java Module System, the method call above returns always null.

How can I get the same information with current Java plattforms?

1 Answers

Get the value from the system properties:

String vendor = System.getProperty("java.vm.vendor");

That is a documented property, so should always be there.

Related