I would like to determine the operating system of the host that my Java program is running programmatically (for example: I would like to be able to load different propertie
I think following can give broader coverage in fewer lines
import org.apache.commons.exec.OS;
if (OS.isFamilyWindows()){
//load some property
}
else if (OS.isFamilyUnix()){
//load some other property
}
More details here: https://commons.apache.org/proper/commons-exec/apidocs/org/apache/commons/exec/OS.html