version '8.92' ext.download = makeDownloadTask( url: "http://ftp.heanet.ie/mirrors/funtoo/distfiles/oracle-java/jdk-" + "${project.version.asType(String).replace('.', 'u')}-linux-x64.tar.gz", sha256: '79a3f25e9b466cb9e969d1772ea38550de320c88e9119bf8aa11ce8547c39987') apply from: '../oracle.gradle' tasks.untar.doLast { // delete JCE policies, see unpackJce project.delete("${buildDir}/unpacked/dist/jre/lib/security/local_policy.jar") project.delete("${buildDir}/unpacked/dist/jre/lib/security/US_export_policy.jar") } final downloadJce = makeDownloadTask( url: 'http://enos.itcollege.ee/~jpoial/allalaadimised/jdk8/jce_policy-8.zip', sha256: 'f3020a3922efd6626c2fff45695d527f34a8020e938a49292561f18ad1320b59') task unpackJce(type: Copy) { into file("${buildDir}/unpacked/dist/jre/lib/security") from zipTree(downloadJce.dest) eachFile { FileCopyDetails fcd -> fcd.path = fcd.path.substring(path.indexOf('/') + 1) } } tasks.unpackJce.dependsOn(downloadJce) tasks.unpackJce.mustRunAfter(tasks.untar) ospackage { into '/usr/lib/jvm/java-8-oraclejdk' from unpackJce.outputs.files } activator.env['JAVA_HOME'] = '/usr/lib/jvm/java-8-oraclejdk' tasks.getByName('activator').doFirst { file("${buildDir}/unpacked/dist/bin").list().each { activator.bin[it] = "/usr/lib/jvm/java-8-oraclejdk/bin/${it}" } }