[FEATURE] Added JavaUtil#getVersion

This commit is contained in:
JKetelaar
2016-01-09 21:40:41 +01:00
parent 6d3ab146ac
commit 46c5232cf4
3 changed files with 17 additions and 1 deletions
@@ -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));
}
}