Package com.jidesoft.utils
Class SystemInfo
java.lang.Object
com.jidesoft.utils.SystemInfo
A utility class can detect OS system information.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the user's home directory.static int
static String
Returns the version of the java class we're using.static String
Returns the vendor for java we're using.static String
Returns the version of java we're using.static String
getOS()
Returns the operating system.static String
Returns the operating system architecture.static String
Returns the operating system version.static boolean
isAnyMac()
Returns whether or not the os is any Mac os.static boolean
isBSD()
Returns whether or not the os is *BSD.static boolean
Returns whether the default locale is one of the three language - Chinese, Japanese or Korean - also known as CJK.static boolean
isCJKLocale
(Locale locale) Returns whether the locale is one of the three language - Chinese, Japanese or Korean - also known as CJK.static boolean
Gets the state of the flag which indicates if the old Windows look and feel should be rendered.static boolean
Returns whether or no the JDK version is 1.3 and above.static boolean
Returns whether or no the JDK version is 1.4.2 and above.static boolean
Returns whether or no the JDK version is 1.4 and above.static boolean
Returns whether or no the JDK version is 1.5 and above.static boolean
Returns whether or no the JDK version is 6 and above.static boolean
Returns whether or no the JDK version is 6u10 and above.static boolean
Returns whether or no the JDK version is 6u14 and above.static boolean
Returns whether or no the JDK version is 6u25 and above.static boolean
Returns whether or no the JDK version is 1.7 and above.static boolean
Returns whether or no the JDK version is 1.7u40 and above.static boolean
Returns whether or no the JDK version is 1.8 and above.static boolean
Returns whether or no the JDK version is 1.9 and above.static boolean
isJdkVersion
(double majorVersion, int minorVersion, int build) Returns whether or not the JDK version is exactly the version you are expectingstatic boolean
isJdkVersionAbove
(double majorVersion, int minorVersion, int build) Returns whether or not the JDK version is above the version, including the version, you are expectingstatic boolean
isJdkVersionBelow
(double majorVersion, int minorVersion, int build) Returns whether or not the JDK version is below the version, including the version, you are expectingstatic boolean
isLinux()
Returns whether or not the os is Linux.static boolean
Returns whether or not the os is Mac 9.1 or earlier.static boolean
isMacOSX()
Returns whether or not the os is Mac OSX.static boolean
Gets the state of the hide mnemonic flag.static boolean
Returns whether or not the os is Solaris.static boolean
isUnix()
Returns whether or not the os is some version of Unix, defined here as only Solaris, Linux or *BSD.static boolean
Returns whether or not the os is some version of Windows.static boolean
Returns whether or not the os is some version of Windows 2003.static boolean
Returns whether or not the os is some version of Windows 7.static boolean
Returns whether or not the os is some version of Windows 8.static boolean
Returns whether or not the os is some version of Windows 95.static boolean
Returns whether or not the os is some version of Windows 98.static boolean
Returns whether or not the os is some version of Windows NT.static boolean
Returns whether or not the os is some version of Windows Vista.static boolean
Returns whether or not the os is some version of Windows Vista or Windows 7.static boolean
Returns whether or not the os is some version of Windows XP.static void
setSupportsTray
(boolean support) Set supportTray to false in case dll is missing.static boolean
Returns true if this is Windows NT or Windows 2000 and hence can support a system tray feature.
-
Method Details
-
getJavaVersion
Returns the version of java we're using.- Returns:
- the java version.
-
getJavaVendor
Returns the vendor for java we're using.- Returns:
- the java vendor.
-
getJavaClassVersion
Returns the version of the java class we're using.- Returns:
- the java class version.
-
getOS
Returns the operating system.- Returns:
- the os name.
-
getOSVersion
Returns the operating system version.- Returns:
- the os version.
-
getOSArchitecture
Returns the operating system architecture.- Returns:
- the os architecture.
-
getCurrentDirectory
Returns the user's home directory.- Returns:
- the user home .
-
supportsTray
public static boolean supportsTray()Returns true if this is Windows NT or Windows 2000 and hence can support a system tray feature.- Returns:
- true of system tray is supported.
-
setSupportsTray
public static void setSupportsTray(boolean support) Set supportTray to false in case dll is missing.- Parameters:
support
- true or false.
-
isWindows
public static boolean isWindows()Returns whether or not the os is some version of Windows.- Returns:
- true if the application is running on some Windows version, false otherwise.
-
isClassicWindows
public static boolean isClassicWindows()Gets the state of the flag which indicates if the old Windows look and feel should be rendered. This flag is used by the component UI delegates as a hint to determine which style the component should be rendered.- Returns:
- true if Windows 95 and Windows NT 4 look and feel should be rendered.
-
isWindowsNTor2000
public static boolean isWindowsNTor2000()Returns whether or not the os is some version of Windows NT.- Returns:
- true if the application is running on Windows NT or 2000, false otherwise.
-
isWindowsXP
public static boolean isWindowsXP()Returns whether or not the os is some version of Windows XP.- Returns:
- true if the application is running on Windows XP, false otherwise.
-
isWindowsVista
public static boolean isWindowsVista()Returns whether or not the os is some version of Windows Vista.- Returns:
- true if the application is running on Windows Vista, false otherwise.
-
isWindows7
public static boolean isWindows7()Returns whether or not the os is some version of Windows 7.- Returns:
- true if the application is running on Windows 7, false otherwise.
-
isWindows8
public static boolean isWindows8()Returns whether or not the os is some version of Windows 8.- Returns:
- true if the application is running on Windows 8, false otherwise.
- Since:
- 3.4.9
-
isWindowsVistaAbove
public static boolean isWindowsVistaAbove()Returns whether or not the os is some version of Windows Vista or Windows 7.- Returns:
- true if the application is running on Windows Vista or Windows 7, false otherwise.
-
isWindows95
public static boolean isWindows95()Returns whether or not the os is some version of Windows 95.- Returns:
- true if the application is running on Windows XP, false otherwise.
-
isWindows98
public static boolean isWindows98()Returns whether or not the os is some version of Windows 98.- Returns:
- true if the application is running on Windows XP, false otherwise.
-
isWindows2003
public static boolean isWindows2003()Returns whether or not the os is some version of Windows 2003.- Returns:
- true if the application is running on Windows 2003, false otherwise.
-
isMacClassic
public static boolean isMacClassic()Returns whether or not the os is Mac 9.1 or earlier.- Returns:
- true if the application is running on a Mac version prior to OSX, false otherwise.
-
isMacOSX
public static boolean isMacOSX()Returns whether or not the os is Mac OSX.- Returns:
- true if the application is running on Mac OSX, false otherwise.
-
isAnyMac
public static boolean isAnyMac()Returns whether or not the os is any Mac os.- Returns:
- true if the application is running on Mac OSX or any previous mac version, false otherwise.
-
isSolaris
public static boolean isSolaris()Returns whether or not the os is Solaris.- Returns:
- true if the application is running on Solaris, false otherwise.
-
isLinux
public static boolean isLinux()Returns whether or not the os is Linux.- Returns:
- true if the application is running on Linux, false otherwise.
-
isBSD
public static boolean isBSD()Returns whether or not the os is *BSD.- Returns:
- true if the application is running on *BSD, false otherwise.
-
isUnix
public static boolean isUnix()Returns whether or not the os is some version of Unix, defined here as only Solaris, Linux or *BSD.- Returns:
- true if the application is running on a type of UNIX such as Linux, Solaris or *BSD, false otherwise.
-
isJdk13Above
public static boolean isJdk13Above()Returns whether or no the JDK version is 1.3 and above.- Returns:
- true if the application is running on JDK 1.3 and above, false otherwise.
-
isJdk142Above
public static boolean isJdk142Above()Returns whether or no the JDK version is 1.4.2 and above.- Returns:
- true if the application is running on JDK 1.4.2 and above, false otherwise.
-
isJdk14Above
public static boolean isJdk14Above()Returns whether or no the JDK version is 1.4 and above.- Returns:
- true if the application is running on JDK 1.4 and above, false otherwise.
-
isJdk15Above
public static boolean isJdk15Above()Returns whether or no the JDK version is 1.5 and above.- Returns:
- true if the application is running on JDK 1.5 and above, false otherwise.
-
isJdk6Above
public static boolean isJdk6Above()Returns whether or no the JDK version is 6 and above.- Returns:
- true if the application is running on JDK 6 and above, false otherwise.
-
isJdk6u10Above
public static boolean isJdk6u10Above()Returns whether or no the JDK version is 6u10 and above.- Returns:
- true if the application is running on JDK 6u10 and above, false otherwise.
-
isJdk6u14Above
public static boolean isJdk6u14Above()Returns whether or no the JDK version is 6u14 and above. There are some heavyweight component and lightweight component mixing changes in JDK6u14.- Returns:
- true if the application is running on JDK 6u14 and above, false otherwise.
-
isJdk6u25Above
public static boolean isJdk6u25Above()Returns whether or no the JDK version is 6u25 and above. Event firing for JComboBox changes in JDK6u25.- Returns:
- true if the application is running on JDK 6u25 and above, false otherwise.
-
isJdk7Above
public static boolean isJdk7Above()Returns whether or no the JDK version is 1.7 and above.- Returns:
- true if the application is running on JDK 1.7 and above, false otherwise.
-
isJdk7u40Above
public static boolean isJdk7u40Above()Returns whether or no the JDK version is 1.7u40 and above.- Returns:
- true if the application is running on JDK 1.7u40 and above, false otherwise.
-
isJdk8Above
public static boolean isJdk8Above()Returns whether or no the JDK version is 1.8 and above.- Returns:
- true if the application is running on JDK 1.8 and above, false otherwise.
- Since:
- 3.4.9
-
isJdk9Above
public static boolean isJdk9Above()Returns whether or no the JDK version is 1.9 and above.- Returns:
- true if the application is running on JDK 1.9 and above, false otherwise.
- Since:
- 4.0
-
isJdkVersion
public static boolean isJdkVersion(double majorVersion, int minorVersion, int build) Returns whether or not the JDK version is exactly the version you are expecting- Parameters:
majorVersion
- your intended major version for JDK6u10, it should be 1.6minorVersion
- your intended major version for JDK6u10, it should be 0build
- your intended major version for JDK6u10, it should be 10- Returns:
- true if the application is running on the input version, false otherwise.
-
isJdkVersionAbove
public static boolean isJdkVersionAbove(double majorVersion, int minorVersion, int build) Returns whether or not the JDK version is above the version, including the version, you are expecting- Parameters:
majorVersion
- your intended major version for JDK6u10, it should be 1.6minorVersion
- your intended major version for JDK6u10, it should be 0build
- your intended major version for JDK6u10, it should be 10- Returns:
- true if the application is running on the input version, false otherwise.
-
isJdkVersionBelow
public static boolean isJdkVersionBelow(double majorVersion, int minorVersion, int build) Returns whether or not the JDK version is below the version, including the version, you are expecting- Parameters:
majorVersion
- your intended major version for JDK6u10, it should be 1.6minorVersion
- your intended major version for JDK6u10, it should be 0build
- your intended major version for JDK6u10, it should be 10- Returns:
- true if the application is running on the input version, false otherwise.
-
isCJKLocale
public static boolean isCJKLocale()Returns whether the default locale is one of the three language - Chinese, Japanese or Korean - also known as CJK.- Returns:
- true if the default locale is in CJK.
-
isCJKLocale
Returns whether the locale is one of the three language - Chinese, Japanese or Korean - also known as CJK.- Parameters:
locale
- the locale to be checked.- Returns:
- true if the default locale is in CJK.
-
getDisplayScale
public static int getDisplayScale() -
isMnemonicHidden
public static boolean isMnemonicHidden()Gets the state of the hide mnemonic flag. This only has meaning if this feature is supported by the underlying OS.- Returns:
- true if mnemonics are hidden, otherwise, false
- Since:
- 3.7.2
-