org.apache.commons.lang
Class SystemUtils

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

public class SystemUtils
extends 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 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 String JAVA_CLASS_PATH
          System Property: java.class.path Java class path.
static String JAVA_CLASS_VERSION
          System Property: java.class.version Java class format version number.
static String JAVA_COMPILER
          System Property: java.compiler Name of JIT compiler to use.
static String JAVA_EXT_DIRS
          System Property: java.ext.dirs Path of extension directory or directories.
static String JAVA_HOME
          System Property: java.home Java installation directory.
static String JAVA_IO_TMPDIR
          System Property: java.io.tmpdir Default temp file path.
static String JAVA_LIBRARY_PATH
          System Property: java.library.path List of paths to search when loading libraries.
static String JAVA_SPECIFICATION_NAME
          System Property: java.specification.name Java Runtime Environment specification name.
static String JAVA_SPECIFICATION_VENDOR
          System Property: java.specification.vendor Java Runtime Environment specification vendor.
static String JAVA_SPECIFICATION_VERSION
          System Property: java.specification.version Java Runtime Environment specification version.
static String JAVA_VENDOR
          System Property: java.vendor Java vendor-specific string.
static String JAVA_VENDOR_URL
          System Property: java.vendor.url Java vendor URL.
static String JAVA_VERSION
          System Property: java.version Java version number.
static String JAVA_VM_NAME
          System Property: java.vm.name Java Virtual Machine implementation name.
static String JAVA_VM_SPECIFICATION_NAME
          System Property: java.vm.specification.name Java Virtual Machine specification name.
static String JAVA_VM_SPECIFICATION_VENDOR
          System Property: java.vm.specification.vendor Java Virtual Machine specification vendor.
static String JAVA_VM_SPECIFICATION_VERSION
          System Property: java.vm.specification.version Java Virtual Machine specification version.
static String JAVA_VM_VENDOR
          System Property: java.vm.vendor Java Virtual Machine implementation vendor.
static String JAVA_VM_VERSION
          System Property: java.vm.version Java Virtual Machine implementation version.
static String LINE_SEPARATOR
          System Property: line.separator Line separator ("\n" on UNIX).
static String OS_ARCH
          System Property: os.arch Operating system architecture.
static String OS_NAME
          System Property: os.name Operating system name.
static String OS_VERSION
          System Property: os.version Operating system version.
static String PATH_SEPARATOR
          System Property: path.separator Path separator (":" on UNIX).
static String USER_DIR
          System Property: user.dir User's current working directory.
static String USER_HOME
          System Property: user.home User's home directory.
static 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, toString, wait, wait, wait
 

Field Detail

FILE_SEPARATOR

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


JAVA_CLASS_PATH

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


JAVA_CLASS_VERSION

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


JAVA_COMPILER

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


JAVA_EXT_DIRS

public static final 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 String JAVA_HOME
System Property: java.home Java installation directory. First in version: 1.1


JAVA_IO_TMPDIR

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


JAVA_LIBRARY_PATH

public static final 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 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 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 String JAVA_SPECIFICATION_VERSION
System Property: java.specification.version Java Runtime Environment specification version. First in version: 1.2


JAVA_VENDOR

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


JAVA_VENDOR_URL

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


JAVA_VERSION

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


JAVA_VM_NAME

public static final 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 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 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 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 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 String JAVA_VM_VERSION
System Property: java.vm.version Java Virtual Machine implementation version. First in version: 1.2


LINE_SEPARATOR

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


OS_ARCH

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


OS_NAME

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


OS_VERSION

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


PATH_SEPARATOR

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


USER_DIR

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


USER_HOME

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


USER_NAME

public static final 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