How to get Operating System name using Java

[134 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
        



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.


Comments



Search
For Sponsored Advertisement OR Freelance Programming Article Submission, Contact us at atechdailyweb@gmail.com
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