public abstract class

JdkVersion

extends Object
java.lang.Object
   ↳ org.springframework.core.JdkVersion

Class Overview

Internal helper class used to find the Java/JVM version that Spring is operating on, to allow for automatically adapting to the present platform's capabilities.

Note that Spring requires JVM 1.5 or higher, as of Spring 3.0.

Summary

Constants
int JAVA_13 Constant identifying the 1.3.x JVM (JDK 1.3).
int JAVA_14 Constant identifying the 1.4.x JVM (J2SE 1.4).
int JAVA_15 Constant identifying the 1.5 JVM (Java 5).
int JAVA_16 Constant identifying the 1.6 JVM (Java 6).
int JAVA_17 Constant identifying the 1.7 JVM (Java 7).
Public Constructors
JdkVersion()
Public Methods
static String getJavaVersion()
Return the full Java version string, as returned by System.getProperty("java.version").
static int getMajorJavaVersion()
Get the major version code.
static boolean isAtLeastJava14()
This method is deprecated. as of Spring 3.0 which requires Java 1.5+
static boolean isAtLeastJava15()
This method is deprecated. as of Spring 3.0 which requires Java 1.5+
static boolean isAtLeastJava16()
This method is deprecated. as of Spring 3.0, in favor of reflective checks for the specific Java 1.6 classes of interest
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int JAVA_13

Also: SpringCore

Constant identifying the 1.3.x JVM (JDK 1.3).

Constant Value: 0 (0x00000000)

public static final int JAVA_14

Also: SpringCore

Constant identifying the 1.4.x JVM (J2SE 1.4).

Constant Value: 1 (0x00000001)

public static final int JAVA_15

Also: SpringCore

Constant identifying the 1.5 JVM (Java 5).

Constant Value: 2 (0x00000002)

public static final int JAVA_16

Also: SpringCore

Constant identifying the 1.6 JVM (Java 6).

Constant Value: 3 (0x00000003)

public static final int JAVA_17

Also: SpringCore

Constant identifying the 1.7 JVM (Java 7).

Constant Value: 4 (0x00000004)

Public Constructors

public JdkVersion ()

Also: SpringCore

Public Methods

public static String getJavaVersion ()

Also: SpringCore

Return the full Java version string, as returned by System.getProperty("java.version").

Returns
  • the full Java version string

public static int getMajorJavaVersion ()

Also: SpringCore

Get the major version code. This means we can do things like if (getMajorJavaVersion() < JAVA_14).

Returns
  • a code comparable to the JAVA_XX codes in this class

public static boolean isAtLeastJava14 ()

Also: SpringCore

This method is deprecated.
as of Spring 3.0 which requires Java 1.5+

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

public static boolean isAtLeastJava15 ()

Also: SpringCore

This method is deprecated.
as of Spring 3.0 which requires Java 1.5+

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

public static boolean isAtLeastJava16 ()

Also: SpringCore

This method is deprecated.
as of Spring 3.0, in favor of reflective checks for the specific Java 1.6 classes of interest

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