Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between "java.vendor" vs "java.vm.vendor"?

Is there a difference between java.vendor and java.vm.vendor properties in Java?

It appears that the two are always the same. Is that a correction assumption?

If you know of scenarios where these two values are not the same please list them.

Edit:

I'm trying to figure out which property would tell me if current java is Oracle or Apple or OpenJDK or another JVM. Until now I checked for both of these properties. But is it safe to assume that I only need to check java.vendor?

like image 595
Saeid Nourian Avatar asked Sep 14 '15 17:09

Saeid Nourian


People also ask

What is the difference between JVM vendor and JVM vendor?

Due to java API, java.vendor is a java runtime environment vendor and java.vm.vendor is a java virtual machine implementation vendor. There is a number of different JVMs, so the values may differ in some specific cases. And it's not guaranted, that JVM will always return both values.

How to get the vendor name of running VM in Java?

To get the vendor name of running VM (Virtual Machine) in Java, we use the getProperties () method, which is defined in System class, while calling the method, we need to pass the property name to get the vendor name of running Java VM. The property to get the vendor name is: "java.vm.vendor"

What is the difference between program argument and VM argument in Java?

7 Program Argument:Program arguments are arguments that are passed to your application, which are accessible via the "args" String array parameter of your main method. VM Argument:VM arguments are environment or system argument that needed by JVM to execute the program. VM arguments are read from system property as below java instruction.

What is the difference between Oracle JVM and custom JVM?

The "Oracle Corporation" that you saw shows the Oracle developed your current JVM. Different companies make their own JVM's if they aren't satisfied with the Oracle one. For example, a custom JVM should still be able to run Java code correctly but it might offer some advanced security. Share Improve this answer Follow


1 Answers

Due to java API, java.vendor is a java runtime environment vendor and java.vm.vendor is a java virtual machine implementation vendor. There is a number of different JVMs, so the values may differ in some specific cases. And it's not guaranted, that JVM will always return both values.

like image 116
Stanislav Avatar answered Oct 24 '22 15:10

Stanislav