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

1

6

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?

Pickpocket answered 14/9, 2015 at 17:3 Comment(0)
W
2

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.

Weller answered 14/9, 2015 at 18:6 Comment(3)
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?Pickpocket
Why are you checking this? It seems to me that if JVMs differ in some way that you would have to check this that there is really no guarantee of consistent behaviour in future versions no matter what you check.Percolation
Agree with @WillShackleford, it seems, there is no any guarantee, that nothing changes in the future. So, if at the moment java.vendor gives you expected result, you can rely on it now, but just now and for current JRE versions you have.Weller

© 2022 - 2024 — McMap. All rights reserved.