Java code to view all system Properties

Source: Internet
Author: User

what is a system attribute?

System Properties refer to the operating system configuration information and software information associated with the user program.

User Program-related property examples
    • File.separator: File delimiter:"\" under the Windows environment, "/" under Linux environment;
    • User.dir: The Current user program is located in the directory;
    • Path.separator: The path delimiter for the current operating system ;
    • Os.version: operating system version ;
    • User.Name: User login name ;
    • Os.name: operating system name ;
    • Java.ext.dirs:The installation directory of the JDK ;
    • Java.home:installation directory of Java real-time running environment ;
    • User.home: user home directory ;
Java code View properties for all systems
publicclass SystemProperty {    publicstaticvoidmain(String args[]) {        Properties props = System.getProperties();        Iterator<Object> iter = props.keySet().iterator();        while (iter.hasNext()) {            String key = (String) iter.next();            " = " + props.get(key));        }    }}
The results of my native run

Java.runtime.name = Java (TM) SE Runtime Environment
Sun.boot.library.path = F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\bin
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) 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:\hxlprogrammerpath\javapractise
Java.runtime.version = 1.6.0_13-b03
Java.awt.graphicsenv = Sun.awt.Win32GraphicsEnvironment
Java.endorsed.dirs = F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\endorsed
Os.arch = AMD64
Java.io.tmpdir = C:\users\admini~1\appdata\local\temp\
Line.separator =

Java.vm.specification.vendor = Sun Microsystems Inc.
User.variant =
Os.name = Windows Vista
sun.jnu.encoding = GBK
Java.library.path = F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;.; C:\Windows\Sun\Java\bin; C:\Windows\system32; C:\windows;d:\quick; C:\oracle\ora81\bin;d:\my-study-material\maven\apache-maven-3.3.3\bin; E:\jdk\bin; F:\app\Administrator\product\11.2.0\dbhome_1\bin; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86) \ati Technologies\ati. ace\core-static; E:\mysql-advanced-5.6.20-winx64\bin; C:\Program Files\tortoisesvn\bin; E:\IBM_ROSE\common; E:\posix\mingw32\bin; F:\Vim\vim74
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:\Users\Administrator
User.timezone =
Java.awt.printerjob = Sun.awt.windows.WPrinterJob
file.encoding = GBK
Java.specification.version = 1.6
Java.class.path = E:\hxlprogrammerpath\javapractise\bin; F:\myeclipse\Common\plugins\org.junit_4.8.2.v4_8_2_v20110321-1705\junit.jar; F:\myeclipse\Common\plugins\org.hamcrest.core_1.1.0.v20090501071000.jar; E:\hxlprogrammerpath\javapractise\lib\poi-3.11-20141221.jar
User.Name = Administrator
Java.vm.specification.version = 1.0
Java.home = F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre
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:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\ext; C:\Windows\Sun\Java\lib\ext
Sun.boot.class.path = F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\resources.jar; F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\rt.jar; F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\sunrsasign.jar; F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\jsse.jar; F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\jce.jar; F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\charsets.jar; F:\myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\classes
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

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Java code to view all system Properties

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.