How to get Operating System name using Java

[2604 views]




In this article, we will learn how to print or find Operating System name on which your Java Application is running by writing a simple Code.

To Find Operating System(OS) Name using Java, we use "os.name" Environment variable, as each OS, stores its name in this property.

public class FindOS { public static void main(String args[]) { String os = System.getProperty("os.name"); System.out.print("Your OS is "+os); } }

Output:

Your OS is Linux
                 



Clear Any Java Interview by Reading our Ebook Once.


Can you clear Java Interview?


Health is Wealth? Check Best Medical Insurance for you:-



Comments










Search
Have Technical Doubts????


Hot Deals ends in













Technical Quizzes Specially For You:

Search Tags

    Find Operating System name using Java language

    OS name using Java