Java code to view all system attributes
What are system attributes?
System Properties refer to the operating system configuration information and software information related to user programs.
Examples of user program-Related PropertiesFile. separator: file separator:
"/" In Windows and Linux "/"; User. dir:
Directory of the current user program; Path. separator:
Path delimiter of the current operating system; OS. version:
Operating system version; User. name:
User Logon Name; OS. name:
Operating system name; Java. ext. dirs:
JDK installation directory; Java. home:
Installation Directory of Java real-time Runtime Environment; User. home:
User main directory;
Java code to view all system attributes
public class SystemProperty { public static void main(String args[]) { Properties props = System.getProperties(); Iterator iter = props.keySet().iterator(); while (iter.hasNext()) { String key = (String) iter.next(); System.out.println(key + = + props.get(key)); } }}
Result After running on the local machine
Java. runtime. name = Java (TM) SE Runtime Environment
Sun. boot. library. path = F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrein
Java. vm. version = 11.3-b02
Java. vm. vendor = Sun Microsystems Inc.
Java. venduo. url = http://java.sun.com/
Path. separator =;
Java. vm. name = Java HotSpot (TM) 64-Bit Server VM
File. encoding. pkg = sun. io
Sun. java. launcher = SUN_STANDARD
User. country = CN
Sun. OS. patch. level = Service Pack 1
Java. vm. specification. name = Java Virtual Machine Specification
User. dir = E: hxlprogrammerpathjavapractise
Java. runtime. version = 1.6.0 _ 13-b03
Java. awt. graphicsenv = sun. awt. Win32GraphicsEnvironment
Java. endorsed. dirs = F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelibendorsed
OS. arch = amd64
Java. io. tmpdir = C: UsersADMINI ~ 1 AppDataLocalTemp
Line. separator =
Java. vm. specification. vendor = Sun Microsystems Inc.
User. variant =
OS. name = Windows Vista
Sun. jnu. encoding = GBK
Java. library. path = F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013in ;.; c: WindowsSunJavain; C: Windowssystem32; C: Windows; D: quick; C: OracleOra81in; D: my-study-materialMavenapache-maven-3.3.3in; E: jdkin; F: appAdministratorproduct. 2.0dbhome _ 1in; C: Windowssystem32; C: Windows; C: WindowsSystem32Wbem; C: WindowsSystem32WindowsPowerShell1.0; C: Program Files (x86) ATI ~iesati. ACECore-Static; E: mysql-advanced-5.6.20-winx64in; C: Program FilesTortoiseSVNin; E: IBM_ROSEcommon; E: posixmingw32in; F: Vimim74
Java. specification. name = Java Platform API Specification
Java. class. version = 50.0
Sun. management. compiler = HotSpot 64-Bit Server Compiler
OS. version = 6.1
User. home = C: UsersAdministrator
User. timezone =
Java. awt. printerjob = sun. awt. windows. WPrinterJob
File. encoding = GBK
Java. specification. version = 1.6
Java. class. path = E: hxlprogrammerpathjavapractisein; F: myeclipseCommonpluginsorg. junit_4.8.2.v4_8_2_v20110321-1705junit.jar; F: myeclipseCommonpluginsorg. hamcrest. core_1.1.0.v20090501_1000.jar; E: hxlprogrammerpathjavapractiselibpoi-3.11-20141221.jar
User. name = Administrator
Java. vm. specification. version = 1.0
Java. home = F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jre
Sun. arch. data. model = 64
User. language = zh
Java. specification. vendor = Sun Microsystems Inc.
Awt. toolkit = sun. awt. windows. WToolkit
Java.vm.info = mixed mode
Java. version = 1.6.0 _ 13
Java. ext. dirs = F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelibext; C: WindowsSunJavalibext
Sun. boot. class. path = F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelib esources. jar; F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelib t. jar; F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelibsunrsasign.jar; F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelibjsse.jar; F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelibjce.jar; F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jrelibcharsets.jar; F: myeclipseCommoninarycom. sun. java. jdk. win32.x86 _ 64_1.6.0.013jreclasses
Java. vendor = Sun Microsystems Inc.
File. separator =
Java. vendor. url. bug = http://java.sun.com/cgi-bin/bugreport.cgi
Sun. io. unicode. encoding = UnicodeLittle
Sun. cpu. endian = little
Sun. desktop = windows
Sun. cpu. isalist = amd64