Occasionally, system. getproperty () is used, which is inconvenient to find. Here is the record memo:
Written Test classes:
Public class testsystemproperty <br/>{< br/> Public static void main (string [] ARGs) <br/>{< br/> system. out. println ("Java Runtime Environment version:/N" + system. getproperty ("Java. version "); <br/> system. out. println ("Java Runtime Environment vendor:/N" + system. getproperty ("Java. vendor "); <br/> system. out. println ("Java vendor URL:/N" + system. getproperty ("Java. vendor. URL "); <br/> system. out. println ("Java installation directory:/N" + system. getproperty ("Java. home "); <br/> system. out. println ("Java Virtual Machine Specification Version:/N" + system. getproperty ("Java. VM. specification. version "); <br/> system. out. println ("Java class format version:/N" + system. getproperty ("Java. class. version "); <br/> system. out. println ("Java class path:/N" + system. getproperty ("Java. class. path "); <br/> system. out. println ("List of paths searched during Database loading:/N" + system. getproperty ("Java. library. path "); <br/> system. out. println ("Default temporary file path:/N" + system. getproperty ("Java. io. tmpdir "); <br/> system. out. println ("Name of the JIT compiler to be used:/N" + system. getproperty ("Java. compiler "); <br/> system. out. println ("path of one or more extended directories:/N" + system. getproperty ("Java. ext. dirs "); <br/> system. out. println ("operating system name:/N" + system. getproperty ("OS. name "); <br/> system. out. println ("Operating System Architecture:/N" + system. getproperty ("OS. arch "); <br/> system. out. println ("operating system version:/N" + system. getproperty ("OS. version "); <br/> system. out. println ("file separator ("/"in UNIX systems):/N" + system. getproperty ("file. separator "); <br/> system. out. println ("path separator (": "in UNIX systems):/N" + system. getproperty ("path. separator "); <br/> system. out. println ("line separator ("/n "in UNIX):/N" + system. getproperty ("line. separator "); <br/> system. out. println ("User Account name:/N" + system. getproperty ("user. name "); <br/> system. out. println ("user's home directory:/N" + system. getproperty ("user. home "); <br/> system. out. println ("current working directory of the User:/N" + system. getproperty ("user. dir "); <br/>}< br/>}
From JDK 1.5.0 documents ents
Java. Version |
Java Runtime Environment version |
Java. Vendor |
Java Runtime Environment vendor |
Java. Vendor. url |
Java vendor URL |
Java. Home |
Java installation directory |
Java. VM. Specification. Version |
Java Virtual Machine standard version |
Java. VM. Specification. Vendor |
Java virtual machine specification vendor |
Java. VM. Specification. Name |
Java virtual machine specification name |
Java. VM. Version |
Java Virtual Machine implementation version |
Java. VM. Vendor |
Java Virtual Machine implementation vendor |
Java. VM. Name |
Java Virtual Machine implementation name |
Java. Specification. Version |
Java Runtime Environment Standard version |
Java. Specification. Vendor |
Java Runtime Environment specification vendor |
Java. Specification. Name |
Java Runtime Environment specification name |
Java. Class. Version |
Java format version number |
Java. Class. Path |
Java class path |
Java. Library. Path |
List of search paths when the library is loaded |
Java. Io. tmpdir |
Default temporary file path |
Java. Compiler |
Name of the JIT compiler to be used |
Java. Ext. dirs |
Path of one or more extended Directories |
OS. Name |
Operating system name |
OS. Arch |
Operating System Architecture |
OS. Version |
Operating system version |
File. Separator |
File separator ("/" in UNIX) |
Path. Separator |
Path separator (":" in UNIX) |
Line. Separator |
Line separator ("/n" in UNIX ") |
User. Name |
User Account Name |
User. Home |
User's home directory |
User. dir |
Current working directory of the user |
The running result is: