How do I get system properties information?


import java.util.Map;
import java.util.Set;

public class GetSystemProperties {
    public static void main(String[] args) {
        RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();

        // Returns a map of names and values of all system
        // properties. This method calls System.getProperties()
        // to get all system properties. Properties whose
        // name or value is not a String are omitted.
        Map<String, String> systemProperties = bean.getSystemProperties();
        Set<String> keys = systemProperties.keySet();
        for (String key : keys) {
            String value = systemProperties.get(key);
            System.out.printf("Property[%s] = %s.%n", key, value);

Some of the properties information captured by the code snippet above are:

Property[java.vm.vendor] = Oracle Corporation.
Property[] = 64.
Property[java.vendor.url] =
Property[user.timezone] = .
Property[] = ID.
Property[] = Mac OS X.
Property[java.vm.specification.version] = 1.8.
Property[] = US.
Property[] = SUN_STANDARD.
Property[sun.boot.library.path] = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib.
Property[] =
Property[http.nonProxyHosts] = local|*.local|169.254/16|*.169.254/16.
Property[sun.cpu.endian] = little.
Property[user.home] = /Users/wsaryada.
Property[user.language] = en.
Property[java.specification.vendor] = Oracle Corporation.
Property[java.home] = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre.
Property[file.separator] = /.
Property[line.separator] = 
Property[java.vm.specification.vendor] = Oracle Corporation.
Property[] = Java Platform API Specification.
Property[java.awt.graphicsenv] = sun.awt.CGraphicsEnvironment.

Wayan Saryada

Founder at Kode Java Org
I am a programmer, a runner, a recreational diver, currently live in the island of Bali, Indonesia. Mostly programming in Java, Spring Framework, Hibernate / JPA. You can support my works by donating here. Thank you 🥳

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.