Name

System

Synopsis

This class defines a platform-independent interface to system facilities, including system properties and system input and output streams. All methods and variables of this class are static, and the class cannot be instantiated. Because the methods defined by this class are low-level system methods, most require special permissions and cannot be executed by untrusted code.

getProperty( ) looks up a named property on the system properties list, returning the optionally specified default value if no property definition is found. getProperties( ) returns the entire properties list. setProperties( ) sets a Properties object on the properties list. In Java 1.2 and later, setProperty( ) sets the value of a system property. In Java 5.0, you can clear a property setting with clearProperty( ) . The following table lists system properties that are always defined. Untrusted code may be unable to read some or all of these properties. Additional properties can be defined using the -D option when invoking the Java interpreter.

Property name

Description

file.separator

Platform directory separator character

path.separator

Platform path separator character

line.separator

Platform line separator character(s)

user.name

Current user s account name

user.home

Home directory of current user

user.dir

The current working directory

java.class.path

Where classes are loaded from

java.class.version

Version of the Java class file format

java.compiler ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.