1 package com.atlassian.plugin.util;
2
3 /**
4 * A simple utility for comparing a java version number to the running version.
5 */
6 public class JavaVersionUtils {
7 private static final Float SPEC_VERSION = Float.valueOf(System.getProperty("java.specification.version"));
8
9 public static boolean satisfiesMinVersion(float versionNumber) {
10 return SPEC_VERSION >= versionNumber;
11 }
12
13 public static Float resolveVersionFromString(String versionStr) {
14 try {
15 return Float.valueOf(versionStr);
16 } catch (Exception e) {
17 return null;
18 }
19 }
20 }