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

Facing Programming Errors. Get Answer within 48 hours:

Want to Clear Java Interview? Read Java Interview Notes prepared by Us

Are You Good enough in Java? Show Your Skills!

Giving is the Master Key to Success, in all applications of human life.


For Sponsored Advertisement OR Freelance Programming Article Submission, Contact us at
Recommended Deals Ends in

Quiz Challenge:
Online Games
Play 2048 Game Online and Relax.
Play 2048 Game Online

Search Tags

    Find Operating System name using Java language

    OS name using Java