Java Reference
In-Depth Information
java.class.version=49.0
java.class.path=classes
java.library.path=/opt/jdk1.5.0_02/jre/lib/i386/client:/opt/
jdk1.5.0_02/jre/lib/i386:/opt
/jdk1.5.0_02/jre/../lib/i386
java.io.tmpdir=/tmp
java.compiler=
java.ext.dirs=/opt/jdk1.5.0_02/jre/lib/ext
os.name=Linux
os.arch=i386
os.version=2.4.20-31.9smp
file.separator=/
path.separator=:
line.separator=\n
user.name=dholmes
user.home=/home/dholmes
user.dir=/home/dholmes/JPL-4e/src
These properties are defined on all systems, although the values will
certainly vary. On any given system many more properties may be
defined. Some of the standard properties are used by classes in the
standard packages. The File class, for example, uses the file.separator
property to build up and break down pathnames. You are also free to
use properties. The following method looks for a personal configuration
file in the user's home directory:
public static File personalConfig(String fileName) {
String home = System.getProperty("user.home");
if (home == null)
return null;
else
return new File(home, fileName);
}
The methods of the System class that deal with the system properties are
Search WWH ::




Custom Search