[FEATURE] Added JavaUtil#getVersion

This commit is contained in:
JKetelaar committed 2016-01-09 21:40:41 +01:00
1 parent 6d3ab146ac
commit 46c5232cf4
3 files changed
+17 -1

No files matched your search

@@ -0,0 +1,15 @@
package org.parabot.environment.api.utils;
/**
* @author JKetelaar
*/
public class JavaUtil {
public static double JAVA_VERSION = getVersion();
static double getVersion () {
String version = System.getProperty("java.version");
int pos = version.indexOf('.');
pos = version.indexOf('.', pos+1);
return Double.parseDouble (version.substring (0, pos));
}
}