At the beginning I want to mention that this is not duplicate of this topic.
I know that I can check OS I'm running from Java, programmatically via System.getProperty("os.name");
My question is: How Java determine my operating system? Other words, when Properties
are loaded/set (especially os.name
) and what command is run to do so?
UPDATE
Not a duplicate of Where (which properties file) does System.getProperty(“key”) reads from? aswell. Im not asking for a place where properties are storaged. Im asking for command that are used to determine OS name.
As @Phylogenesis commented - on Windows it is used a GetVersionEx inside in native c implementation.
What about Unix/Linux?