Java System getProperties() Method

The getProperties() method of Java System class returns the properties of current system. If there is no current set of system property, a set of system properties is first created and initialized.

This system property set includes value for the following keys:

KeyDescription of Associated Value
java.versionJava Runtime Environment version which may be interpreted as a Runtime.Version
java.vendorJava Runtime Environment vendor
java.vendor.urlJava vendor URL
java.homeJava installation directory
java.vm.specification.versionJava Virtual Machine specification version which may be interpreted as a Runtime.Version
java.vm.specification.vendorJava Virtual Machine specification vendor
java.vm.specification.nameJava Virtual Machine specification name
java.vm.versionJava Virtual Machine implementation version which may be interpreted as a Runtime.Version
java.vm.vendorJava Virtual Machine implementation vendor
java.vm.nameJava Virtual Machine implementation name
java.specification.versionJava Runtime Environment specification version which may be interpreted as a Runtime.Version
java.specification.vendorJava Runtime Environment specification vendor
java.specification.nameJava Runtime Environment specification name
java.class.versionJava class format version number
java.class.pathJava class path
java.library.pathList of paths to search when loading libraries
java.io.tmpdirDefault temp file path
java.compilerName of JIT compiler to use
os.nameOperating system name
os.archOperating system architecture
os.versionOperating system version
file.separatorFile separator ("/" on UNIX)
path.separatorPath separator (":" on UNIX)
line.separatorLine separator ("\n" on UNIX)
user.nameUser's account name
user.homeUser's home directory
user.dirUser's current working directory

Syntax

Returns

This method will return the system properties.

Exception

It will return SecutityException, if security manager exist its checkPropertiesAccess method doesn't allow access to the system properties.

Example 1

Output:

Your System propertyfor operating system
Windows 8
amd64
6.2

Example 2

Output:

Your System property for user
shubham
C:\Users\Shubham Jadon
C:\Users\Shubham Jadon\eclipse-workspace\tpoint