Class RuntimeVersion

java.lang.Object
com.google.errorprone.util.RuntimeVersion

public final class RuntimeVersion
extends Object
JDK version string utilities.
  • Method Summary

    Modifier and Type Method Description
    static boolean isAtLeast12()
    Returns true if the current runtime is JDK 12 or newer.
    static boolean isAtLeast13()
    Returns true if the current runtime is JDK 13 or newer.
    static boolean isAtLeast14()
    Returns true if the current runtime is JDK 14 or newer.
    static boolean isAtLeast15()
    Returns true if the current runtime is JDK 15 or newer.
    static boolean isAtLeast16()
    Returns true if the current runtime is JDK 16 or newer.
    static boolean isAtLeast17()
    Returns true if the current runtime is JDK 17 or newer.
    static boolean isAtLeast18()
    Returns true if the current runtime is JDK 18 or newer.
    static boolean isAtLeast19()
    Returns true if the current runtime is JDK 19 or newer.
    static int release()
    Returns the latest --release version.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isAtLeast12

      public static boolean isAtLeast12()
      Returns true if the current runtime is JDK 12 or newer.
    • isAtLeast13

      public static boolean isAtLeast13()
      Returns true if the current runtime is JDK 13 or newer.
    • isAtLeast14

      public static boolean isAtLeast14()
      Returns true if the current runtime is JDK 14 or newer.
    • isAtLeast15

      public static boolean isAtLeast15()
      Returns true if the current runtime is JDK 15 or newer.
    • isAtLeast16

      public static boolean isAtLeast16()
      Returns true if the current runtime is JDK 16 or newer.
    • isAtLeast17

      public static boolean isAtLeast17()
      Returns true if the current runtime is JDK 17 or newer.
    • isAtLeast18

      public static boolean isAtLeast18()
      Returns true if the current runtime is JDK 18 or newer.
    • isAtLeast19

      public static boolean isAtLeast19()
      Returns true if the current runtime is JDK 19 or newer.
    • release

      public static int release()
      Returns the latest --release version.

      Prefer the isAtLeast methods for assumption checks in tests.