1.2k
This examples uses pi4j library to display operating system information
[codesyntax lang=”java”]
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(); } }
[/codesyntax]