Home Code Java operating system information

Java operating system information

by shedboy71

This examples uses pi4j library to display operating system information

import com.pi4j.system.NetworkInfo;
import com.pi4j.system.SystemInfo;
 
import java.io.IOException;
import java.text.ParseException;
 
public class osinfo 
{
 
    public static void main(String[] args) throws InterruptedException, IOException, ParseException 
	{
 
 
 
        System.out.println("----------------------------------------------------");
        System.out.println("OPERATING SYSTEM INFO");
        System.out.println("----------------------------------------------------");
        System.out.println("OS Name           :  " + SystemInfo.getOsName());
        System.out.println("OS Version        :  " + SystemInfo.getOsVersion());
        System.out.println("OS Architecture   :  " + SystemInfo.getOsArch());
        System.out.println("OS Firmware Build :  " + SystemInfo.getOsFirmwareBuild());
        System.out.println("OS Firmware Date  :  " + SystemInfo.getOsFirmwareDate());
 
 
        System.out.println();
        System.out.println();
    }
}

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More