Skip to content

Commit

Permalink
use a better message when rt.jar is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
angryziber committed Dec 26, 2019
1 parent 08ac6bc commit 899e134
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ jobs:
with:
java-version: '8'
architecture: x64
- name: Find rt.jar in Zulu
run: find $JAVA_HOME
- name: Build
run: ./gradlew linux64
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ def packageTask(def platform, def moreJars, def moreLibs, Closure doMore) {
with jar

def rtJar = new File(System.getProperty('java.home') + "/jre/lib/rt.jar")
if (!rtJar.exists()) rtJar = new File('/usr/lib/jvm/java-10-openjdk-amd64/jmods/java.base.jmod') // try Ubuntu version of Java 10
if (!rtJar.exists()) rtJar = new File('/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar') // try Ubuntu version of Java 8 if current Java doesn't have rt.jar
if (!rtJar.exists()) rtJar = new File('/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/rt.jar') // try Ubuntu version of OpenJDK 8
if (!rtJar.exists()) rtJar = new File('/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.base.jmod') // try Debian/Ubuntu version of Java 11
if (!rtJar.exists()) rtJar = new File('/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar') // try Debian/Ubuntu version of Java 8 if current Java doesn't have rt.jar
if (!rtJar.exists()) rtJar = new File('/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/rt.jar') // try Debian/Ubuntu version of OpenJDK 8

if (rtJar.exists()) {
print "Using $rtJar for proguard minimization"
finalizedBy minimizeTask(rtJar, platform, doMore)
}
else {
println "WARNING: not minimizing, Java 8 is currently required for that"
println "WARNING: not minimizing, Java8 rt.jar not found on the system"
doLast(doMore)
}
}
Expand Down

0 comments on commit 899e134

Please sign in to comment.