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 {
8 public static boolean satisfiesMinVersion(float versionNumber)
9 {
10 float specVersion = Float.valueOf(System.getProperty("java.specification.version"));
11 return specVersion >= versionNumber;
12 }
13
14 public static Float resolveVersionFromString(String versionStr)
15 {
16 try
17 {
18 return Float.valueOf(versionStr);
19 }
20 catch(Exception e)
21 {
22 return null;
23 }
24 }
25 }