March 17, 2012

Operating system information in java

To get the operation system information in java

Source code


public class OpertingSystemInfo
{
public static void main(String[] args)
{
String nameOS = "os.name";
String versionOS = "os.version";
String architectureOS = "os.arch";
System.out.println("\n The information about OS");
System.out.println("\nName of the OS: " +
System.getProperty(nameOS));
System.out.println("Version of the OS: " +
System.getProperty(versionOS));
System.out.println("Architecture of THe OS: " +
System.getProperty(architectureOS));
}
}


How to get my computer details in java


If you searching for a third partyAPI that helps you to get other information than above
SIGAR api is one of them

sigar class

read here

Thanking you....

Facebook comments