Package 

Class SystemUtils


  • 
    public class SystemUtils
    
                        

    Helpers for {@code java.lang.System}.

    If a system property cannot be read due to security restrictions, the corresponding field in this class will be set to {@code null} and a message will be written to {@code System.err}.

    #ThreadSafe#

    • Constructor Detail

      • SystemUtils

        SystemUtils()
        SystemUtils instances should NOT be constructed in standard programming.
    • Method Detail

      • getJavaHome

         static File getJavaHome()

        Gets the Java home directory as a {@code File}.

      • getJavaIoTmpDir

         static File getJavaIoTmpDir()

        Gets the Java IO temporary directory as a {@code File}.

      • getUserDir

         static File getUserDir()

        Gets the user directory as a {@code File}.

      • getUserHome

         static File getUserHome()

        Gets the user home directory as a {@code File}.

      • isJavaVersionAtLeast

         static boolean isJavaVersionAtLeast(JavaVersion requiredVersion)

        Is the Java version at least the requested version.

        Example input:

        • {@code 1.2f} to test for Java 1.2
        • {@code 1.31f} to test for Java 1.3.1
        Parameters:
        requiredVersion - the required version, for example 1.