# JavaLanguageVersion

interface JavaLanguageVersion : Comparable<JavaLanguageVersion> (source)

Represents a Java Language version

#### Since

6.7

## Functions

asInt
Link copied to clipboard
abstract fun asInt(): Int
Return this version as a number, 14 for Java 14.
canCompileOrRun
Link copied to clipboard
abstract fun canCompileOrRun(otherVersion: Int): Boolean
abstract fun canCompileOrRun(other: JavaLanguageVersion): Boolean
Indicates if this version can compile or run code based on the passed in language version.
compareTo
Link copied to clipboard
abstract fun compareTo(p: T): Int
current
Link copied to clipboard
@Incubating
open fun current(): JavaLanguageVersion
Get the current (i.e., the current runtime) Java Language version.
of
Link copied to clipboard
open fun of(version: Int): JavaLanguageVersion
open fun of(version: String): JavaLanguageVersion
toString
Link copied to clipboard
abstract fun toString(): String
Return this version as a String, "14" for Java 14.