public boolean isEnabledForCurrentJRE ( ) { if ( "" . equals ( requireJRE ) ) { return true ; } try { JavaVersion requiredVersion = new JavaVersion ( requireJRE ) ; JavaVersion runtimeVersion = JavaVersion . getRuntimeVersion ( ) ; if ( DEBUG_JAVA_VERSION ) { System . out . println ( "Checking JRE version for " + getShortName ( ) + " (requires " + requiredVersion + ", running on " + runtimeVersion + ")" ) ; } boolean enabledForCurrentJRE = runtimeVersion . isSameOrNewerThan ( requiredVersion ) ; if ( DEBUG_JAVA_VERSION ) { System . out . println ( "\t==> " + enabledForCurrentJRE ) ; } return enabledForCurrentJRE ; } catch ( JavaVersionException e ) { if ( DEBUG_JAVA_VERSION ) { System . out . println ( "Couldn't check Java version: " + e . toString ( ) ) ; e . printStackTrace ( System . out ) ; } return false ; } }
Check to see if we are running on a recent - enough JRE for this detector to be enabled .