devxlogo

Determining the Operating System at Runtime

Determining the Operating System at Runtime

The following java code allows you to identify the operating system on which your application is running:

 class OperatingSystem{ public static void main(String args[]) { System.out.println ("Operating system : " + System.getProperty("os.name")); System.out.println ("Operating system version : " + System.getProperty("os.version")); } } 

size=3>

devx-admin

Share the Post: