org.apache.commons.lang
Class SystemUtils

java.lang.Object
  |
  +--org.apache.commons.lang.SystemUtils

public class SystemUtils
extends java.lang.Object

Common System class helpers.

Version:
$Id: SystemUtils.java,v 1.2.2.1 2002/11/22 23:31:13 bayard Exp $
Author:
Based on code from Avalon Excalibur, Based on code from Lucene, Stephen Colebourne, Steve Downey

Field Summary
static java.lang.String FILE_SEPARATOR
          System Property: file.separator File separator ("/" on UNIX).
static boolean IS_JAVA_1_1
          True iff this is Java version 1.1.
static boolean IS_JAVA_1_2
          True iff this is Java version 1.2.
static boolean IS_JAVA_1_3
          True iff this is Java version 1.3.
static boolean IS_JAVA_1_4
          True iff this is Java version 1.4.
static boolean IS_JAVA_1_5
          True iff this is Java version 1.3.
static java.lang.String JAVA_CLASS_PATH
          System Property: java.class.path Java class path.
static java.lang.String JAVA_CLASS_VERSION
          System Property: java.class.version Java class format version number.
static java.lang.String JAVA_COMPILER
          System Property: java.compiler Name of JIT compiler to use.
static java.lang.String JAVA_EXT_DIRS
          System Property: java.ext.dirs Path of extension directory or directories.
static java.lang.String JAVA_HOME
          System Property: java.home Java installation directory.
static java.lang.String JAVA_IO_TMPDIR
          System Property: java.io.tmpdir Default temp file path.
static java.lang.String JAVA_LIBRARY_PATH
          System Property: java.library.path List of paths to search when loading libraries.
static java.lang.String JAVA_SPECIFICATION_NAME
          System Property: java.specification.name Java Runtime Environment specification name.
static java.lang.String JAVA_SPECIFICATION_VENDOR
          System Property: java.specification.vendor Java Runtime Environment specification vendor.
static java.lang.String JAVA_SPECIFICATION_VERSION
          System Property: java.specification.version Java Runtime Environment specification version.
static java.lang.String JAVA_VENDOR
          System Property: java.vendor Java vendor-specific string.
static java.lang.String JAVA_VENDOR_URL
          System Property: java.vendor.url Java vendor URL.
static java.lang.String JAVA_VERSION
          System Property: java.version Java version number.
static java.lang.String JAVA_VM_NAME
          System Property: java.vm.name Java Virtual Machine implementation name.
static java.lang.String JAVA_VM_SPECIFICATION_NAME
          System Property: java.vm.specification.name Java Virtual Machine specification name.
static java.lang.String JAVA_VM_SPECIFICATION_VENDOR
          System Property: java.vm.specification.vendor Java Virtual Machine specification vendor.
static java.lang.String JAVA_VM_SPECIFICATION_VERSION
          System Property: java.vm.specification.version Java Virtual Machine specification version.
static java.lang.String JAVA_VM_VENDOR
          System Property: java.vm.vendor Java Virtual Machine implementation vendor.
static java.lang.String JAVA_VM_VERSION
          System Property: java.vm.version Java Virtual Machine implementation version.
static java.lang.String LINE_SEPARATOR
          System Property: line.separator Line separator ("\n" on UNIX).
static java.lang.String OS_ARCH
          System Property: os.arch Operating system architecture.
static java.lang.String OS_NAME
          System Property: os.name Operating system name.
static java.lang.String OS_VERSION
          System Property: os.version Operating system version.
static java.lang.String PATH_SEPARATOR
          System Property: path.separator Path separator (":" on UNIX).
static java.lang.String USER_DIR
          System Property: user.dir User's current working directory.
static java.lang.String USER_HOME
          System Property: user.home User's home directory.
static java.lang.String USER_NAME
          System Property: user.name User's account name.
 
Constructor Summary
SystemUtils()
          SystemUtils instances should NOT be constructed in standard programming.
 
Method Summary
static float getJavaVersion()
          Get the Java version number as a float.
static boolean isJavaVersionAtLeast(float requiredVersion)
          Is the Java version at the the requested version.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

FILE_SEPARATOR

public static final java.lang.String FILE_SEPARATOR
System Property: file.separator File separator ("/" on UNIX). First in version: 1.1

JAVA_CLASS_PATH

public static final java.lang.String JAVA_CLASS_PATH
System Property: java.class.path Java class path. First in version: 1.1

JAVA_CLASS_VERSION

public static final java.lang.String JAVA_CLASS_VERSION
System Property: java.class.version Java class format version number. First in version: 1.1

JAVA_COMPILER

public static final java.lang.String JAVA_COMPILER
System Property: java.compiler Name of JIT compiler to use. First in version: 1.4

JAVA_EXT_DIRS

public static final java.lang.String JAVA_EXT_DIRS
System Property: java.ext.dirs Path of extension directory or directories. First in version: 1.3

JAVA_HOME

public static final java.lang.String JAVA_HOME
System Property: java.home Java installation directory. First in version: 1.1

JAVA_IO_TMPDIR

public static final java.lang.String JAVA_IO_TMPDIR
System Property: java.io.tmpdir Default temp file path. First in version: 1.4

JAVA_LIBRARY_PATH

public static final java.lang.String JAVA_LIBRARY_PATH
System Property: java.library.path List of paths to search when loading libraries. First in version: 1.4

JAVA_SPECIFICATION_NAME

public static final java.lang.String JAVA_SPECIFICATION_NAME
System Property: java.specification.name Java Runtime Environment specification name. First in version: 1.2

JAVA_SPECIFICATION_VENDOR

public static final java.lang.String JAVA_SPECIFICATION_VENDOR
System Property: java.specification.vendor Java Runtime Environment specification vendor. First in version: 1.2

JAVA_SPECIFICATION_VERSION

public static final java.lang.String JAVA_SPECIFICATION_VERSION
System Property: java.specification.version Java Runtime Environment specification version. First in version: 1.2

JAVA_VENDOR

public static final java.lang.String JAVA_VENDOR
System Property: java.vendor Java vendor-specific string. First in version: 1.1

JAVA_VENDOR_URL

public static final java.lang.String JAVA_VENDOR_URL
System Property: java.vendor.url Java vendor URL. First in version: 1.1

JAVA_VERSION

public static final java.lang.String JAVA_VERSION
System Property: java.version Java version number. First in version: 1.1

JAVA_VM_NAME

public static final java.lang.String JAVA_VM_NAME
System Property: java.vm.name Java Virtual Machine implementation name. First in version: 1.2

JAVA_VM_SPECIFICATION_NAME

public static final java.lang.String JAVA_VM_SPECIFICATION_NAME
System Property: java.vm.specification.name Java Virtual Machine specification name. First in version: 1.2

JAVA_VM_SPECIFICATION_VENDOR

public static final java.lang.String JAVA_VM_SPECIFICATION_VENDOR
System Property: java.vm.specification.vendor Java Virtual Machine specification vendor. First in version: 1.2

JAVA_VM_SPECIFICATION_VERSION

public static final java.lang.String JAVA_VM_SPECIFICATION_VERSION
System Property: java.vm.specification.version Java Virtual Machine specification version. First in version: 1.2

JAVA_VM_VENDOR

public static final java.lang.String JAVA_VM_VENDOR
System Property: java.vm.vendor Java Virtual Machine implementation vendor. First in version: 1.2

JAVA_VM_VERSION

public static final java.lang.String JAVA_VM_VERSION
System Property: java.vm.version Java Virtual Machine implementation version. First in version: 1.2

LINE_SEPARATOR

public static final java.lang.String LINE_SEPARATOR
System Property: line.separator Line separator ("\n" on UNIX). First in version: 1.1

OS_ARCH

public static final java.lang.String OS_ARCH
System Property: os.arch Operating system architecture. First in version: 1.1

OS_NAME

public static final java.lang.String OS_NAME
System Property: os.name Operating system name. First in version: 1.1

OS_VERSION

public static final java.lang.String OS_VERSION
System Property: os.version Operating system version. First in version: 1.1

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
System Property: path.separator Path separator (":" on UNIX). First in version: 1.1

USER_DIR

public static final java.lang.String USER_DIR
System Property: user.dir User's current working directory. First in version: 1.1

USER_HOME

public static final java.lang.String USER_HOME
System Property: user.home User's home directory. First in version: 1.1

USER_NAME

public static final java.lang.String USER_NAME
System Property: user.name User's account name. First in version: 1.1

IS_JAVA_1_1

public static final boolean IS_JAVA_1_1
True iff this is Java version 1.1.

IS_JAVA_1_2

public static final boolean IS_JAVA_1_2
True iff this is Java version 1.2.

IS_JAVA_1_3

public static final boolean IS_JAVA_1_3
True iff this is Java version 1.3.

IS_JAVA_1_4

public static final boolean IS_JAVA_1_4
True iff this is Java version 1.4.

IS_JAVA_1_5

public static final boolean IS_JAVA_1_5
True iff this is Java version 1.3.
Constructor Detail

SystemUtils

public SystemUtils()
SystemUtils instances should NOT be constructed in standard programming. Instead, the class should be used as SystemUtils.FILE_SEPARATOR. This constructor is public to permit tools that require a JavaBean instance to operate.
Method Detail

getJavaVersion

public static float getJavaVersion()
Get the Java version number as a float. Example output:
1.2f for JDK 1.2
1.31f for JDK 1.3.1
Returns:
the version, for example 1.31f for JDK 1.3.1

isJavaVersionAtLeast

public static boolean isJavaVersionAtLeast(float requiredVersion)
Is the Java version at the the requested version. Example input:
1.2f for JDK 1.2
1.31f for JDK 1.3.1
Parameters:
requiredVersion - the required version, for example 1.31f
Returns:
true if the actual version is equal or greater than the required version


Copyright (c) 2001-2002 - Apache Software Foundation