How to get Operating System name using Java


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 "" Environment variable, as each OS, stores its name in this property.

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


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:-


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