evant / gradle-retrolambda

A gradle plugin for getting java lambda support in java 6, 7 and android
Apache License 2.0
5.3k stars 449 forks source link

Beta version - Error:When running gradle with java 5, 6 or 7 #187

Open loeschg opened 8 years ago

loeschg commented 8 years ago

Since switching to the new beta 3.3.0-beta4, every time I run from Android Studio, I get the following error:

Error:When running gradle with java 5, 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable JAVA8_HOME

I know this seems to be a lingering issue which points mostly to IntelliJ/Android Studio, however given prior to switching to the new beta (from me.tatarka:gradle-retrolambda:3.2.3), I didn't have any (what I assume to be) path issues, I figured it was worth filing. The only way I can figure out how to get around this is to start Android Studio from the command-line where I have the following in my .zshrc:

export JAVA8_HOME=$(/usr/libexec/java_home -v 1.8)
export JAVA7_HOME=$(/usr/libexec/java_home -v 1.7)
export JAVA_HOME=$JAVA8_HOME

Also, potentially relevant, our CI started failing on the update to 3.3.0-beta4 with the same error. We fixed it by adding JAVA8_HOME, even though we already had JAVA_HOME (pointing to jdk8) and JAVA7_HOME (pointing to jdk7).