getting core 4

This commit is contained in:
huangyuhui
2016-01-19 23:16:13 +08:00
parent ec5bb40758
commit ab08a8d3f5
18 changed files with 68 additions and 58 deletions

View File

@@ -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) {

View File

@@ -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) {