How to Find Operating System in JAVA

Java can find operating system of the machine where java program is executing. getProperty() is a method which find the system properties of the computer. OS property returns a String name of operating system platform.
We can detect the various operating systems in java. This operating system can be Linux, Window, Mac and other server version.

Example to find operating System in JSP

<%@ page language="java"%>
<html>
<head>
<title>How to find Operating System in JSP</title>
</head>

<body>
<%
 // This will return operation system name
 out.println("Operating System :"+System.getProperty("os.name"));
%>
</body>
</html>
Bookmark  

 

Leave a Reply

Security Code:

 

  Random Post