Skip to content

Instantly share code, notes, and snippets.

@khotyn
Created November 29, 2011 01:34
Show Gist options
  • Save khotyn/1402943 to your computer and use it in GitHub Desktop.
Save khotyn/1402943 to your computer and use it in GitHub Desktop.
Get operating system name using Java
package com.khotyn.test;
/**
* Quick Test
*
* @author khotyn 2011-11-29 上午9:34:25
*/
public class Test {
public static void main(String[] args) {
System.out.println(System.getProperty("os.name"));
}
}
@khotyn
Copy link
Author

khotyn commented Nov 29, 2011

The output of this piece of code running in Ubuntu 11.10:Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment