dshrenik
asked on
Identify Operating System
Please let me know how I can figure out the Operating system (windows or mac) through java code.
Thanks!
Thanks!
System.getProperty("os.nam e")
ASKER
Is it possible to identify the family of OS?
I want to know if it windows / mac / linux. But I don't care which version.
I want to know if it windows / mac / linux. But I don't care which version.
String s = System.getProperty("os.nam
if(s.startsWith("Windows")
but you should run some tests whaat weach system returns
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But is there a generic way to figure out the family.
Like in ant, I can do this:
<condition property="avn" value="avn.bat">
<os family="windows"/>
</condition>
Like in ant, I can do this:
<condition property="avn" value="avn.bat">
<os family="windows"/>
</condition>
I am not sure there is a generic way - and how could it be - someone can come up with some new system
which will do something new
the tests in http://www.mkyong.com/java/how-to-detect-os-in-java-systemgetpropertyosname/
should cover most of the cases, but not guaranteed of faling
which will do something new
the tests in http://www.mkyong.com/java/how-to-detect-os-in-java-systemgetpropertyosname/
should cover most of the cases, but not guaranteed of faling
ASKER
Could you answer this question:
https://www.experts-exchange.com/questions/27393652/Check-status-of-a-service.html
Thanks!
https://www.experts-exchange.com/questions/27393652/Check-status-of-a-service.html
Thanks!