Java Get OS Name
Posted by blogmeister on
September 14, 2008
This method returns the name of the operating system that the program is running in.
|
1 2 3 4 5 6 7 8 9 10 11 12 |
public static String getOsName() { String os = ""; if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) { os = "windows"; } else if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) { os = "linux"; } else if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) { os = "mac"; } return os; } |










4 Responses to “Java Get OS Name”
Watch the latest episodes from your favourite tv-show and full, new movies for free! It’s right here: http://freefuntube.com
By Mike Thomson on Dec 16, 2010
I love this blog What a super blog!
By movie streaming on May 10, 2011
@movie streaming: thank you
By tech on May 10, 2011
Nice info, Thanks a lot for the info.
By latest tricks on Jul 29, 2011