getting core 4
This commit is contained in:
@@ -20,6 +20,7 @@ package org.jackhuang.hellominecraft.utils.system;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.jackhuang.hellominecraft.C;
|
||||
import org.jackhuang.hellominecraft.HMCLog;
|
||||
@@ -30,6 +31,19 @@ import org.jackhuang.hellominecraft.HMCLog;
|
||||
*/
|
||||
public class Java {
|
||||
|
||||
public static final List<Java> JAVA;
|
||||
|
||||
static {
|
||||
List<Java> temp = new ArrayList<>();
|
||||
temp.add(new Java("Default", System.getProperty("java.home")));
|
||||
temp.add(new Java("Custom", null));
|
||||
if (OS.os() == OS.WINDOWS)
|
||||
temp.addAll(Java.queryAllJavaHomeInWindowsByReg());
|
||||
if (OS.os() == OS.OSX)
|
||||
temp.addAll(Java.queryAllJDKInMac());
|
||||
JAVA = Collections.unmodifiableList(temp);
|
||||
}
|
||||
|
||||
String name, home;
|
||||
|
||||
public Java(String name, String home) {
|
||||
|
||||
@@ -100,9 +100,11 @@ public class SwingUtils {
|
||||
/**
|
||||
* Open URL by java.awt.Desktop
|
||||
*
|
||||
* @param link
|
||||
* @param link null is allowed but will be ignored
|
||||
*/
|
||||
public static void openLink(String link) {
|
||||
if (link == null)
|
||||
return;
|
||||
try {
|
||||
java.awt.Desktop.getDesktop().browse(new URI(link));
|
||||
} catch (Throwable e) {
|
||||
|
||||
Reference in New Issue
Block a user