Merge pull request #4100 from babbaj/fix-proguard-lol

proguard: get java from gradle runtime before JAVA_HOME
This commit is contained in:
leijurv 2023-08-15 21:33:42 -07:00 committed by GitHub
commit 7daf1022c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -114,6 +114,9 @@ public class ProguardTask extends BaritoneGradleTask {
ex.printStackTrace(); ex.printStackTrace();
} }
path = findJavaByGradleCurrentRuntime();
if (path != null) return path;
try { try {
path = findJavaByJavaHome(); path = findJavaByJavaHome();
if (path != null) return path; if (path != null) return path;
@ -122,10 +125,6 @@ public class ProguardTask extends BaritoneGradleTask {
ex.printStackTrace(); ex.printStackTrace();
} }
path = findJavaByGradleCurrentRuntime();
if (path != null) return path;
throw new Exception("Unable to find java to determine ProGuard libraryjars. Please specify forkOptions.executable in javaCompile," + throw new Exception("Unable to find java to determine ProGuard libraryjars. Please specify forkOptions.executable in javaCompile," +
" JAVA_HOME environment variable, or make sure to run Gradle with the correct JDK (a v1.8 only)"); " JAVA_HOME environment variable, or make sure to run Gradle with the correct JDK (a v1.8 only)");
} }