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?
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.
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"
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With