In this tutorial we will - Find out Operating System name using java program.
We can find out Operating System name by using System.getProperty("os.name") in java program
How to Find out Operating System name using java program >
/** Find current Operating System name */
public class FindCurrentOperatingSystemNameExample {
public static void main(String[] args) {
String currentOperatingSystemName = System.getProperty("os.name");
System.out.println("current (OS) Operating System name = "+
currentOperatingSystemName);
}
}
/*OUTPUT
current (OS) Operating System name = Windows 7
*/
|
Output of program may vary on different systems.
Summary -
So in this tutorial we learned how to find Operating System name using java program.
Having any doubt? or you you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.
RELATED LINKS>
Find out Java version (32 or 64 bit) installed in your system using java program and cmd
Find out JDK version installed in your system using java program
Find eclipse version in your system
Labels:
Core Java