mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 08:39:09 +00:00
[FEATURE] Added JavaUtil#getVersion
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user