Access to old Java JDK home

android
#1

Hey, in my Android project I have a Java sub module which use retrolambda. but to make it works it require that you specify the path to JDK7.
So you do something like this in your java module gradle file:

apply plugin: 'java'
apply plugin: 'me.tatarka.retrolambda'

dependencies {
 }

sourceSets {
    test {
        output.resourcesDir = output.classesDir
    }
}

retrolambda {
    oldJdk System.getenv("JAVA7_HOME")
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

(works well on my machine)

But on bitrise JAVA7_HOME doesn’t seems to exist. Any hint on that ? does a Java 7 home exist ? if not what could be a solution ? workaround ?

Thanks

0 Likes

#2

Hi @agonist,

Java/JDK7 is only pre-installed on the Ubuntu 14 stacks, the newer Ubuntu 16 stacks have Java 8 pre-installed (right now).

You can find docs about how you can install another Java/JDK version at: http://devcenter.bitrise.io/android/android-tips-and-tricks/#installing-using-java-version-x

The easiest way to experiment with this is to download the same Docker image we use on bitrise.io as the build environment, so that you can run commands and debug things locally in the exact same environment your build will run in on bitrise.io. Related guide: http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/
This of course is not required, but might help to speed up iterating on the config.

If you have any questions, just let us know!

0 Likes