Get system properties with System.getProperties() |
package java_systemproperties; import java.util.Enumeration; import java.util.Properties; /** * * @web http://java-buddy.blogspot.com/ */ public class Java_SystemProperties { public static void main(String[] args) { Properties properties = System.getProperties(); System.out.println(properties.toString()); System.out.println("\n"); Enumeration<String> prop = (Enumeration<String>) properties.propertyNames(); while(prop.hasMoreElements()){ String propName = prop.nextElement(); System.out.println( propName + " : " + System.getProperty(propName)); } } }
Related: Get info of running jvm, os and cpu - tested on Windows 10
thanks for the post :)
ReplyDelete