I know there is such a question on SO, but I could not find it. So asking again...
I need to set up properties to my program, but I need to make it OS indipendent - running both on Windows XP and Linux (unknown distro, unknown version)
More specifically - I need to set up to the system where to find the chromedriver
binary. I need something like this pseudocode:
if (getOs() == Windows){
System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, "chromedriver.exe");
} else{
System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, "chromedriver");
}
Now I need the part for getting the OS. Thanks for help.
System.getProperty("os.name");
System.getProperty("os.version");
System.getProperty("os.arch");
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