mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-06 00:37:52 +00:00
[FEATURE] Added JavaUtil#getVersion
This commit is contained in:
@@ -11,6 +11,7 @@ import org.parabot.core.network.proxy.ProxyType;
|
|||||||
import org.parabot.core.ui.BotUI;
|
import org.parabot.core.ui.BotUI;
|
||||||
import org.parabot.core.ui.ServerSelector;
|
import org.parabot.core.ui.ServerSelector;
|
||||||
import org.parabot.core.ui.utils.UILog;
|
import org.parabot.core.ui.utils.UILog;
|
||||||
|
import org.parabot.environment.api.utils.JavaUtil;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -29,6 +30,7 @@ public final class Landing {
|
|||||||
private static String username;
|
private static String username;
|
||||||
private static String password;
|
private static String password;
|
||||||
public static void main(String... args) throws IOException {
|
public static void main(String... args) throws IOException {
|
||||||
|
System.out.println(JavaUtil.JAVA_VERSION);
|
||||||
Core.initiateBugsnagInstance();
|
Core.initiateBugsnagInstance();
|
||||||
|
|
||||||
parseArgs(args);
|
parseArgs(args);
|
||||||
|
|||||||
@@ -67,5 +67,4 @@ public class JavaFX extends Library {
|
|||||||
public static boolean isValid() {
|
public static boolean isValid() {
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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