Class JavaEnvironment


  • public abstract class JavaEnvironment
    extends 
    Deprecated.
    This class is no longer used in Shiro and will be removed in the next major version.
    Internal helper class used to find the Java/JDK version that Shiro is operating within, to allow for automatically adapting to the present platform's capabilities.

    Note that Shiro does not support 1.2 or earlier JVMs - only 1.3 and later.

    This class was borrowed and heavily based upon a nearly identical version found in the , with minor modifications. The original author names and copyright (Apache 2.0) has been left in place. A special thanks to Rod Johnson, Juergen Hoeller, and Rick Evans for making this available.

    Since:
    0.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int JAVA_13
      Deprecated.
      Constant identifying the 1.3.x JVM (JDK 1.3).
      static int JAVA_14
      Deprecated.
      Constant identifying the 1.4.x JVM (J2SE 1.4).
      static int JAVA_15
      Deprecated.
      Constant identifying the 1.5 JVM (Java 5).
      static int JAVA_16
      Deprecated.
      Constant identifying the 1.6 JVM (Java 6).
      static int JAVA_17
      Deprecated.
      Constant identifying the 1.7 JVM.
      static int JAVA_18
      Deprecated.
      Constant identifying the 1.8 JVM.
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaEnvironment()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static int getMajorVersion()
      Deprecated.
      Get the major version code.
      static getVersion()
      Deprecated.
      Return the full Java version string, as returned by System.getProperty("java.version").
      static boolean isAtLeastVersion14()
      Deprecated.
      Convenience method to determine if the current JVM is at least Java 1.4.
      static boolean isAtLeastVersion15()
      Deprecated.
      Convenience method to determine if the current JVM is at least Java 1.5 (Java 5).
      static boolean isAtLeastVersion16()
      Deprecated.
      Convenience method to determine if the current JVM is at least Java 1.6 (Java 6).
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Field Detail

      • JAVA_13

        public static final int JAVA_13
        Deprecated.
        Constant identifying the 1.3.x JVM (JDK 1.3).
        See Also:
        Constant Field Values
      • JAVA_14

        public static final int JAVA_14
        Deprecated.
        Constant identifying the 1.4.x JVM (J2SE 1.4).
        See Also:
        Constant Field Values
      • JAVA_15

        public static final int JAVA_15
        Deprecated.
        Constant identifying the 1.5 JVM (Java 5).
        See Also:
        Constant Field Values
      • JAVA_16

        public static final int JAVA_16
        Deprecated.
        Constant identifying the 1.6 JVM (Java 6).
        See Also:
        Constant Field Values
      • JAVA_17

        public static final int JAVA_17
        Deprecated.
        Constant identifying the 1.7 JVM.
        See Also:
        Constant Field Values
      • JAVA_18

        public static final int JAVA_18
        Deprecated.
        Constant identifying the 1.8 JVM.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JavaEnvironment

        public JavaEnvironment()
        Deprecated.
    • Method Detail

      • getVersion

        public static  getVersion()
        Deprecated.
        Return the full Java version string, as returned by System.getProperty("java.version").
        Returns:
        the full Java version string
        See Also:
      • getMajorVersion

        public static int getMajorVersion()
        Deprecated.
        Get the major version code. This means we can do things like if (getMajorVersion() < JAVA_14).
        Returns:
        a code comparable to the JAVA_XX codes in this class
        See Also:
        JAVA_13, JAVA_14, JAVA_15, JAVA_16, JAVA_17, JAVA_18
      • isAtLeastVersion14

        public static boolean isAtLeastVersion14()
        Deprecated.
        Convenience method to determine if the current JVM is at least Java 1.4.
        Returns:
        true if the current JVM is at least Java 1.4
        See Also:
        getMajorVersion(), JAVA_14, JAVA_15, JAVA_16, JAVA_17, JAVA_18
      • isAtLeastVersion15

        public static boolean isAtLeastVersion15()
        Deprecated.
        Convenience method to determine if the current JVM is at least Java 1.5 (Java 5).
        Returns:
        true if the current JVM is at least Java 1.5
        See Also:
        getMajorVersion(), JAVA_15, JAVA_16, JAVA_17, JAVA_18
      • isAtLeastVersion16

        public static boolean isAtLeastVersion16()
        Deprecated.
        Convenience method to determine if the current JVM is at least Java 1.6 (Java 6).
        Returns:
        true if the current JVM is at least Java 1.6
        Since:
        1.2
        See Also:
        getMajorVersion(), JAVA_15, JAVA_16, JAVA_17, JAVA_18