Package com.teamdev.jxbrowser.os
Class Environment
java.lang.Object
com.teamdev.jxbrowser.os.Environment
Provides the details about the current operating system, JVM architecture, JRE version etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Checks the current operating system name and version, JRE version and throws theEnvironmentException
error if they do not meet the minimal operating system and JRE requirements.static Path
Returns an absolute path to the directory where the Chromium binaries are located by default.static boolean
is32Bit()
Indicates whether the current JVM's architecture is 32-bit.static boolean
is64Bit()
Indicates whether the current JVM's architecture is 64-bit.static boolean
isArm()
Indicates whether the current JVM's architecture is ARM.static boolean
isLinux()
Returnstrue
if the current operating system is Linux.static boolean
isMac()
Returnstrue
if the current operating system is macOS.static boolean
Returnstrue
if the current operating system is macOS Big Sur.static boolean
Returnstrue
if the current environment is supported.static boolean
Returnstrue
if the current operating system is Windows.static boolean
Returnstrue
if the current platform is Windows 64-bit.static void
Prints the current environment details to the log with the INFO level.static Path
Returns path to the user's home directory.static Path
Returns path to the user's temp directory.Returns anOptional
that contains a string that represents an absolute path to the local AppData directory of the current user on the Windows platform.
-
Method Details
-
isWindows
public static boolean isWindows()Returnstrue
if the current operating system is Windows. -
isWindows64
public static boolean isWindows64()Returnstrue
if the current platform is Windows 64-bit. -
isMac
public static boolean isMac()Returnstrue
if the current operating system is macOS. -
isMacBigSur
public static boolean isMacBigSur()Returnstrue
if the current operating system is macOS Big Sur. -
isLinux
public static boolean isLinux()Returnstrue
if the current operating system is Linux. -
is64Bit
public static boolean is64Bit()Indicates whether the current JVM's architecture is 64-bit. -
is32Bit
public static boolean is32Bit()Indicates whether the current JVM's architecture is 32-bit. -
isArm
public static boolean isArm()Indicates whether the current JVM's architecture is ARM. -
defaultChromiumDir
Returns an absolute path to the directory where the Chromium binaries are located by default. -
checkEnvironment
public static void checkEnvironment()Checks the current operating system name and version, JRE version and throws theEnvironmentException
error if they do not meet the minimal operating system and JRE requirements.- Throws:
EnvironmentException
- when the current environment and JRE do not meet the minimal OS and JRE requirements
-
isSupported
public static boolean isSupported()Returnstrue
if the current environment is supported. -
traceEnvironment
public static void traceEnvironment()Prints the current environment details to the log with the INFO level. -
win32UserAppDataLocalDir
Returns anOptional
that contains a string that represents an absolute path to the local AppData directory of the current user on the Windows platform.- Throws:
IllegalStateException
- when the current operating system isn't a Windows
-
userTempDir
Returns path to the user's temp directory. -
userHomeDir
Returns path to the user's home directory.
-