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 voidChecks the current operating system name and version, JRE version and throws theEnvironmentExceptionerror if they do not meet the minimal operating system and JRE requirements.static PathReturns an absolute path to the directory where the Chromium binaries are located by default.static booleanis32Bit()Indicates whether the current JVM's architecture is 32-bit.static booleanis64Bit()Indicates whether the current JVM's architecture is 64-bit.static booleanIndicates whether the Mac CPU architecture is Apple Silicon.static booleanisArm()Indicates whether the current JVM's architecture is ARM.static booleanisLinux()Returnstrueif the current operating system is Linux.static booleanisMac()Returnstrueif the current operating system is macOS.static booleanReturnstrueif the current environment is supported.static booleanReturnstrueif the current operating system is Windows.static booleanReturnstrueif the current platform is Windows 64-bit.static voidPrints the current environment details to the log with the INFO level.static PathReturns path to the user's home directory.static PathReturns path to the user's temp directory.Returns the absolute path to the local "AppData" directory of the current Windows user.
-
Method Details
-
isWindows
public static boolean isWindows()Returnstrueif the current operating system is Windows. -
isWindows64
public static boolean isWindows64()Returnstrueif the current platform is Windows 64-bit. -
isMac
public static boolean isMac()Returnstrueif the current operating system is macOS. -
isLinux
public static boolean isLinux()Returnstrueif 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. -
isAppleSilicon
public static boolean isAppleSilicon()Indicates whether the Mac CPU architecture is Apple Silicon. -
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 theEnvironmentExceptionerror 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()Returnstrueif the current environment is supported. -
traceEnvironment
public static void traceEnvironment()Prints the current environment details to the log with the INFO level. -
win32UserAppDataLocalDir
Returns the absolute path to the local "AppData" directory of the current Windows user.- 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.
-