How to list all system properties key and value in Java
Written on December 1, 2009 at 8:24 pm by
mkyong
System properties has contains many information about your Java, you can print all the system properties in “Key” and “Value” format.
Properties props = System.getProperties(); props.list(System.out);
Here’s the output on my computer
-- listing properties -- java.runtime.name=Java(TM) SE Runtime Environment sun.boot.library.path=C:\Program Files\Java\jdk1.6.0_13\jre... java.vm.version=11.3-b02 java.vm.vendor=Sun Microsystems Inc. java.vendor.url=http://java.sun.com/ path.separator=; java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io user.country=US sun.java.launcher=SUN_STANDARD sun.os.patch.level=Service Pack 3 java.vm.specification.name=Java Virtual Machine Specification user.dir=E:\workspace\mkyong java.runtime.version=1.6.0_13-b03 java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment java.endorsed.dirs=C:\Program Files\Java\jdk1.6.0_13\jre... os.arch=x86 java.io.tmpdir=C:\DOCUME~1\snake\LOCALS~1\Temp\ line.separator= java.vm.specification.vendor=Sun Microsystems Inc. user.variant= os.name=Windows XP sun.jnu.encoding=Cp1252 java.library.path=C:\Program Files\Java\jdk1.6.0_13\jre... java.specification.name=Java Platform API Specification java.class.version=50.0 sun.management.compiler=HotSpot Client Compiler os.version=5.1 user.home=C:\Documents and Settings\snake user.timezone= java.awt.printerjob=sun.awt.windows.WPrinterJob file.encoding=Cp1252 java.specification.version=1.6 user.name=snake java.class.path=E:\workspace\mkyong\target\test-class... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=C:\Program Files\Java\jdk1.6.0_13\jre java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=sun.awt.windows.WToolkit java.vm.info=mixed mode, sharing java.version=1.6.0_13 java.ext.dirs=C:\Program Files\Java\jdk1.6.0_13\jre... sun.boot.class.path=C:\Program Files\Java\jdk1.6.0_13\jre... java.vendor=Sun Microsystems Inc. file.separator=\ java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport... sun.cpu.endian=little sun.io.unicode.encoding=UnicodeLittle sun.desktop=windows sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m...
This article was posted in Java category.
Oracle Magazine - Free Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for Java's developers and DBAs, and more.
Securing & Optimizing Linux: The Hacking Solution - Free Guide
A comprehensive collection of Linux security products and explanations in the most simple and structured manner on how to safely and easily configure and run many popular Linux-based applications and services.
The Windows 7 Guide: From Newbies to Pros - Free Guide
In this 46 page guide you will be introduced to Windows 7 and what it has to offer. This guide will go over the software compatible issues, you will learn about the new taskbar, how to use and customize Windows Aero, what Windows 7 Libraries are all about, what software is included in Windows 7, and how easy networking is with Windows 7 along with other topics.
All Java Tutorials
- Java Core Technology - Java RegEx, Java XML, Java I/O, Java Misc
- J2EE Frameworks - Hibernate, Spring 2.5, Spring MVC, Struts 1.x, Struts 2.x
- Build Tools - Maven, Archiva
- Unit Test - jUnit, TestNG
- Client Scripts - jQuery