Displaying Operating System details in Java Program

  1. public class OpertingSystemInfo   
  2. {  
  3.     public static void main(String[] args)  
  4.     {  
  5.         String nameOS = "os.name";          
  6.         String versionOS = "os.version";          
  7.         String architectureOS = "os.arch";  
  8.         System.out.println("\n    The information about OS");  
  9.         System.out.println("\nName of the OS: " + System.getProperty(nameOS));  
  10.         System.out.println("Version of the OS: " + System.getProperty(versionOS));  
  11.         System.out.println("Architecture of THe OS: " + System.getProperty(architectureOS));  
  12.     }