Java-system Properties, GetProperty, setproperty__properties

Source: Internet
Author: User
Tags file separator

Http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

Tutorial/essential/environment/sysprop.html

Http://www.leepoint.net/notes-java/io/30properties_and_preferences/40sysprops/10sysprop.html

http://blog.csdn.net/szwangdf/article/details/4366581

System Properties:

The following table describes some of the most important system properties

Key meaning
"File.separator" Character that separates components of a file path. This is '/' on UNIX and \ ' on Windows.
"Java.class.path" Path used to find directories and JAR archives containing class files. Elements of the class path are separated by a platform-specific character specified in the Path.separatorproperty.
"Java.home" installation directory for Java Runtime environment (JRE)
"Java.vendor" JRE Vendor Name
"Java.vendor.url" JRE Vendor URL
"Java.version" JRE Version number
"Line.separator" Sequence used by operating system to separate lines in text files
"Os.arch" Operating system architecture
"Os.name" Operating system name
"Os.version" Operating system version
"Path.separator" Path separator character used in Java.class.path
"User.dir" User working Directory
"User.home" User Home Directory
"User.Name" User account Name


Properties props=system.getproperties ();
System Properties System.out.println ("Java Running environment version:" +props.getproperty ("java.version"));
SYSTEM.OUT.PRINTLN ("Java Operating Environment provider:" +props.getproperty ("Java.vendor"));
System.out.println ("Java Vendor's URL:" +props.getproperty ("Java.vendor.url"));
System.out.println ("Java Installation path:" +props.getproperty ("Java.home"));
SYSTEM.OUT.PRINTLN ("Java Virtual machine spec version:" +props.getproperty ("java.vm.specification.version"));
SYSTEM.OUT.PRINTLN ("Java Virtual machine specification Vendor:" +props.getproperty ("Java.vm.specification.vendor"));
SYSTEM.OUT.PRINTLN ("Java Virtual machine Specification Name:" +props.getproperty ("Java.vm.specification.name"));
SYSTEM.OUT.PRINTLN ("Java Virtual Machine Implementation version:" +props.getproperty ("java.vm.version"));
SYSTEM.OUT.PRINTLN ("Java Virtual machine Implementation provider:" +props.getproperty ("Java.vm.vendor"));
SYSTEM.OUT.PRINTLN ("Java Virtual machine implementation name:" +props.getproperty ("Java.vm.name"));
System.out.println ("Java Runtime Environment Specification version:" +props.getproperty ("java.specification.version"));
System.out.println ("Java Runtime Environment Specification vendor:" +props.getproperty ("Java.specification.vender")); System.out.println ("JaVA run-time Environment Specification Name: "+props.getproperty (" Java.specification.name "));
System.out.println ("Java Class format version number:" +props.getproperty ("java.class.version"));
System.out.println ("Java classpath:" +props.getproperty ("Java.class.path"));
SYSTEM.OUT.PRINTLN ("List of paths to search when loading library:" +props.getproperty ("Java.library.path"));
SYSTEM.OUT.PRINTLN ("Default temporary file path:" +props.getproperty ("Java.io.tmpdir"));
SYSTEM.OUT.PRINTLN ("Path of one or more extended directories:" +props.getproperty ("Java.ext.dirs"));
System.out.println ("The name of the operating system:" +props.getproperty ("Os.name"));
SYSTEM.OUT.PRINTLN ("Architecture of the Operating system:" +props.getproperty ("Os.arch"));
SYSTEM.OUT.PRINTLN ("Operating system version:" +props.getproperty ("os.version"));   System.out.println ("File separator:" +props.getproperty ("File.separator"));   In Unix system is "/" System.out.println ("Path separator:" +props.getproperty ("Path.separator"));   In Unix systems is ":" System.out.println ("line delimiter:" +props.getproperty ("Line.separator"));
In Unix system is "n" System.out.println ("User's account name:" +props.getproperty ("User.Name"));
System.out.println ("User's home directory:" +props.getproperty ("User.home")); System.out. println ("User's current working directory:" +props.getproperty ("User.dir")); 



Related Article

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.