fix: circular dependency and Java 8 feature use

This commit is contained in:
Ryan Dowling 2019-06-12 20:46:48 +10:00
parent 12a892c1b0
commit 5b4156b44e
No known key found for this signature in database
GPG key ID: 5539FCDB88950EFD
8 changed files with 13 additions and 27 deletions

1
.gitignore vendored
View file

@ -1,7 +1,6 @@
# Directories
.gradle/
.settings/
.vscode
bin/
build/
dist/

1
.vscode/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
settings.json

3
.vscode/launch.json vendored
View file

@ -1,7 +1,4 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{

View file

@ -1,4 +0,0 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.home": "C:\\Program Files\\Amazon Corretto\\jdk11.0.3_7"
}

View file

@ -276,24 +276,18 @@ public class App {
}
}
if (Files.notExists(FileSystem.CONFIGS)) {
try {
if (Files.list(FileSystem.CONFIGS.getParent()).count() > 1) {
String content = HTMLUtils.centerParagraph("I've detected that you may "
+ "not have installed this in the right location.<br/><br/>The exe or jar file should "
+ "be placed in it's own folder with nothing else in it.<br/><br/>Are you 100% sure "
+ "that's what you've done?");
if (Files.notExists(FileSystem.CONFIGS) && FileSystem.CONFIGS.getParent().toFile().listFiles().length > 1) {
String content = HTMLUtils.centerParagraph("I've detected that you may "
+ "not have installed this in the right location.<br/><br/>The exe or jar file should "
+ "be placed in it's own folder with nothing else in it.<br/><br/>Are you 100% sure "
+ "that's what you've done?");
int returnOption = DialogManager.optionDialog().setParent(null).setTitle("Warning")
.setContent(content).addOption("Yes It's Fine", true)
.addOption("Whoops. I'll Change That Now").setType(DialogManager.ERROR).show();
int returnOption = DialogManager.optionDialog().setParent(null).setTitle("Warning")
.setContent(content).addOption("Yes It's Fine", true)
.addOption("Whoops. I'll Change That Now").setType(DialogManager.ERROR).show();
if (returnOption != 0) {
System.exit(0);
}
}
} catch (IOException e) {
// ignored
if (returnOption != 0) {
System.exit(0);
}
}

View file

@ -214,7 +214,6 @@ public class Instance implements Cloneable {
* Minecraft.
*
* @see com.atlauncher.mclauncher.MCLauncher
* @see com.atlauncher.mclauncher.LegacyMCLauncher
*/
private boolean newLaunchMethod;

View file

@ -1197,7 +1197,7 @@ public class Settings {
if (isUsingCustomJavaPath()) {
this.javaPath = properties.getProperty("javapath", OS.getJavaHome());
} else {
this.javaPath = Java.getActualJavaVersion();
this.javaPath = OS.getJavaHome();
}
}

View file

@ -77,7 +77,7 @@ public class Java {
if (version.equals("Unknown")) {
LogManager.warn("Cannot get Java version from the output of \""
+ String.join(" ", processBuilder.command()) + " -version\"");
+ getPathToSystemJavaExecutable() + " -version\"");
}
return version;