use System.getProperty(String key). Look at the docs for System class to see
all the keys. This will show your OS name, architecture and version:
public class GetProperties {
public static void main(String [] args) {
System.out.println(System.getProperty("os.name"));
System.out.println(System.getProperty("os.arch"));
System.out.println(System.getProperty("os.version"));
}
}