Package: org.gradle.api

## [Java] Enum JavaVersion

- org.gradle.api.JavaVersion

- An enumeration of Java versions.

- - ### Enum Constants Summary

    Enum constants classes
    Enum constant | Description
    --- | ---
    `VERSION_1_1` |
    `VERSION_1_2` |
    `VERSION_1_3` |
    `VERSION_1_4` |
    `VERSION_1_5` |
    `VERSION_1_6` |
    `VERSION_1_7` |
    `VERSION_1_8` |
    `VERSION_1_9` |

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `static JavaVersion` | `current()` Returns the version of the current JVM.
    `static JavaVersion` | `forClassVersion(int classVersion)`
    `String` | `getMajorVersion()`
    `boolean` | `isJava5()`
    `boolean` | `isJava5Compatible()`
    `boolean` | `isJava6()`
    `boolean` | `isJava6Compatible()`
    `boolean` | `isJava7()`
    `boolean` | `isJava7Compatible()`
    `boolean` | `isJava8Compatible()`
    `boolean` | `isJava9Compatible()`
    `String` | `toString()`
    `static JavaVersion` | `toVersion(Object value)` Converts the given object into a `JavaVersion`.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Enum` | `name, equals, toString, hashCode, compareTo, compareTo, valueOf, getDeclaringClass, ordinal, wait, wait, wait, getClass, notify, notifyAll`
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Enum Constant Detail

    - #### JavaVersion VERSION_1_1

    - #### JavaVersion VERSION_1_2

    - #### JavaVersion VERSION_1_3

    - #### JavaVersion VERSION_1_4

    - #### JavaVersion VERSION_1_5

    - #### JavaVersion VERSION_1_6

    - #### JavaVersion VERSION_1_7

    - #### JavaVersion VERSION_1_8

    - #### JavaVersion VERSION_1_9

  - ### Method Detail

    - #### public static JavaVersion current()

      Returns the version of the current JVM.

      Returns:
        The version of the current JVM.

    - #### public static JavaVersion forClassVersion(int classVersion)

    - #### public String getMajorVersion()

    - #### public boolean isJava5()

    - #### public boolean isJava5Compatible()

    - #### public boolean isJava6()

    - #### public boolean isJava6Compatible()

    - #### public boolean isJava7()

    - #### public boolean isJava7Compatible()

    - #### public boolean isJava8Compatible()

    - #### public boolean isJava9Compatible()

    - #### @Override public String toString()

    - #### public static JavaVersion toVersion(Object value)

      Converts the given object into a `JavaVersion`.

      throws:
        IllegalArgumentException when the provided value cannot be converted.
      Parameters:
        `value` - An object whose toString() value is to be converted. May be null.
      Returns:
        The version, or null if the provided value is null.