Package com.bric.multislider
Class Jvm
java.lang.Object
com.bric.multislider.Jvm
Static methods relating to the JVM environment.
Instead of burying a constant like "isQuartz" in its most relevant class (such as OptimizedGraphics2D), it should be stored here so if other classes need to access it they don't necessary have to
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Whether this session is on a Linux machine.static final boolean
Whether this session is on a Mac.static final boolean
Whether this session is on Vista.static final boolean
Whether this session is on Windows Vista or Windows 7.static final boolean
Whether this session is on Windows.static final boolean
Whether this session is on Windows 7.static final boolean
Whether this session is on Windows XP.static final float
The major Java version being used (1.4, 1.5, 1.6, etc.), or -1 if this value couldn't be correctly determined.static final boolean
If on a Mac: whether Quartz is the rendering pipeline. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
This converts the system property "java.version" to a float value.static float
getMajorJavaVersion
(boolean catchSecurityException) static String
Gets basic information about this session's JVM: the OS name & version, the Java version, and (on Mac) whether Quartz is being used.static void
Prints basic information about this session's JVM: the OS name & version, the Java version, and (on Mac) whether Quartz is being used.
-
Field Details
-
javaVersion
public static final float javaVersionThe major Java version being used (1.4, 1.5, 1.6, etc.), or -1 if this value couldn't be correctly determined. -
isMac
public static final boolean isMacWhether this session is on a Mac. -
isLinux
public static final boolean isLinuxWhether this session is on a Linux machine. -
isWindows
public static final boolean isWindowsWhether this session is on Windows. -
isVista
public static final boolean isVistaWhether this session is on Vista. -
isWindows7
public static final boolean isWindows7Whether this session is on Windows 7. -
isWindowsXP
public static final boolean isWindowsXPWhether this session is on Windows XP. -
isVistaOrWindows7
public static final boolean isVistaOrWindows7Whether this session is on Windows Vista or Windows 7. -
usingQuartz
public static final boolean usingQuartzIf on a Mac: whether Quartz is the rendering pipeline. In applets this may throw a security exception; if this cannot be ascertained we assume it is false.
-
-
Constructor Details
-
Jvm
public Jvm()
-
-
Method Details
-
printProfile
public static void printProfile()Prints basic information about this session's JVM: the OS name & version, the Java version, and (on Mac) whether Quartz is being used. -
getProfile
Gets basic information about this session's JVM: the OS name & version, the Java version, and (on Mac) whether Quartz is being used.- Returns:
- profile
-
getMajorJavaVersion
This converts the system property "java.version" to a float value. This drops rightmost digits until a legitimate float can be parsed.
For example, this converts "1.6.0_05" to "1.6".
This value is cached as the system property "java.major.version". Although technically this value is a String, it will always be parseable as a float.- Returns:
- major java version such as 1.6
- Throws:
AccessControlException
- this may be thrown in unsigned applets! Beware!
-
getMajorJavaVersion
public static float getMajorJavaVersion(boolean catchSecurityException) - Parameters:
catchSecurityException
- if true and an exception occurs, then -1 is returned.- Returns:
- the major java version, or -1 if this can't be determined/
-