Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Maria Silva   on Nov 27 In Java Category.

  
Question Answered By: Vicki Fields   on Nov 27

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"));
}
}

Share: