New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup problem? #17

Closed
mellson opened this Issue Feb 19, 2014 · 11 comments

Comments

Projects
None yet
9 participants
@mellson

mellson commented Feb 19, 2014

I keep getting this error in Android Studio 0.4.5

Execution failed for task ':app:patchAndroidJar'.

Retrolambda: null/jre/lib/rt.jar does not exist, make sure that JAVE_HOME or retrolambda.jdk points to a valid version of java8
You can download java8 from https://jdk8.java.net/download.html

I have tried to follow your setup guidelines.
Java 8 is installed and both JAVA8_HOME and JAVA_HOME points to it.

Any ideas?

@evant

This comment has been minimized.

Show comment
Hide comment
@evant

evant Feb 23, 2014

Owner

From the error it appears that the jdk path is not being picked up. Have you tried setting it in build.gradle?

retrolambda {
  jdk 'path-to-jdk'
}

What OS are you running?

Owner

evant commented Feb 23, 2014

From the error it appears that the jdk path is not being picked up. Have you tried setting it in build.gradle?

retrolambda {
  jdk 'path-to-jdk'
}

What OS are you running?

@aradomski

This comment has been minimized.

Show comment
Hide comment
@aradomski

aradomski Feb 24, 2014

I got similar problem. OS: Linux mint, android studio 0.4.6

echo $JAVA8_HOME
/usr/lib/jvm/java-8-oracle
echo $JAVA7_HOME
/usr/lib/jvm/java-7-oracle
echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle

Configuration

apply plugin: 'retrolambda'
retrolambda {
    compile "net.orfjackal.retrolambda:retrolambda:1.1.2"
    jdk System.getenv("JAVA8_HOME")
    oldJdk System.getenv("JAVA7_HOME")
    javaVersion JavaVersion.VERSION_1_7
}
 dependencies {
        classpath 'com.android.tools.build:gradle:0.8.+'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2+'
        classpath 'me.tatarka:gradle-retrolambda:1.2.0'
    }

in android plugin config

  compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

Error:

Execution failed for task ':NavigatorTouch:patchAndroidJar'.
> Retrolambda: null/jre/lib/rt.jar does not exist, make sure that JAVE_HOME or retrolambda.jdk points to a valid version of java8
   You can download java8 from https://jdk8.java.net/download.html

aradomski commented Feb 24, 2014

I got similar problem. OS: Linux mint, android studio 0.4.6

echo $JAVA8_HOME
/usr/lib/jvm/java-8-oracle
echo $JAVA7_HOME
/usr/lib/jvm/java-7-oracle
echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle

Configuration

apply plugin: 'retrolambda'
retrolambda {
    compile "net.orfjackal.retrolambda:retrolambda:1.1.2"
    jdk System.getenv("JAVA8_HOME")
    oldJdk System.getenv("JAVA7_HOME")
    javaVersion JavaVersion.VERSION_1_7
}
 dependencies {
        classpath 'com.android.tools.build:gradle:0.8.+'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2+'
        classpath 'me.tatarka:gradle-retrolambda:1.2.0'
    }

in android plugin config

  compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

Error:

Execution failed for task ':NavigatorTouch:patchAndroidJar'.
> Retrolambda: null/jre/lib/rt.jar does not exist, make sure that JAVE_HOME or retrolambda.jdk points to a valid version of java8
   You can download java8 from https://jdk8.java.net/download.html
@mellson

This comment has been minimized.

Show comment
Hide comment
@mellson

mellson Feb 24, 2014

I am using Mac OS 10.9.1 and now also Android Studio 0.4.6.

I can import the Gradle file, but when I try to make / build the project I get the error.

mellson commented Feb 24, 2014

I am using Mac OS 10.9.1 and now also Android Studio 0.4.6.

I can import the Gradle file, but when I try to make / build the project I get the error.

@aradomski

This comment has been minimized.

Show comment
Hide comment
@aradomski

aradomski Feb 25, 2014

I solved the problem.
Android studio does not look into /home/user/.bashrc and /home/user/.bash_proflle files.
Solutions:

  1. Start android studio from console. (Not double click -> run in terminal, start console check if variables are set then run from it android studio)
  2. set up these variables globally in /etc/environment (not tested)

aradomski commented Feb 25, 2014

I solved the problem.
Android studio does not look into /home/user/.bashrc and /home/user/.bash_proflle files.
Solutions:

  1. Start android studio from console. (Not double click -> run in terminal, start console check if variables are set then run from it android studio)
  2. set up these variables globally in /etc/environment (not tested)
@mellson

This comment has been minimized.

Show comment
Hide comment
@mellson

mellson Feb 25, 2014

I tried solution 1 and this does indeed work.
Thanks for the solution!

mellson commented Feb 25, 2014

I tried solution 1 and this does indeed work.
Thanks for the solution!

@mellson mellson closed this Feb 25, 2014

@ivanarellano

This comment has been minimized.

Show comment
Hide comment
@ivanarellano

ivanarellano Jun 27, 2014

I had this same issue using Android Studio 0.6.1 on Windows 8.1. Since the plugin was not finding the JDK8 environment variable, I had to use the "optional" configuration in gradle. Basically a copy and paste from https://github.com/evant/gradle-retrolambda#configuration.

ivanarellano commented Jun 27, 2014

I had this same issue using Android Studio 0.6.1 on Windows 8.1. Since the plugin was not finding the JDK8 environment variable, I had to use the "optional" configuration in gradle. Basically a copy and paste from https://github.com/evant/gradle-retrolambda#configuration.

@mjurkus

This comment has been minimized.

Show comment
Hide comment
@mjurkus

mjurkus Sep 16, 2014

Second option also works. Defining variables in /etc/environment
Tested on Mac with settings in /etc/launchd.conf and Ubuntu /etc/environment

mjurkus commented Sep 16, 2014

Second option also works. Defining variables in /etc/environment
Tested on Mac with settings in /etc/launchd.conf and Ubuntu /etc/environment

@nicopasso

This comment has been minimized.

Show comment
Hide comment
@nicopasso

nicopasso Sep 29, 2014

@mjurkus could you paste here your /etc/launchd.conf (only the Android Studio/Java parts)?

nicopasso commented Sep 29, 2014

@mjurkus could you paste here your /etc/launchd.conf (only the Android Studio/Java parts)?

@slapsys

This comment has been minimized.

Show comment
Hide comment
@slapsys

slapsys Oct 17, 2014

This is ones I use.

# JAVA
setenv JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home
setenv JAVA7_HOME /Library/Java/JavaVirtualMachines/1.7.0/Contents/Home
setenv JAVA8_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home

# Android
setenv ANDROID_HOME <path-to-sdk>/android_sdk
setenv ANDROID_SDK <path-to-sdk>/android_sdk

It worked till Yosemite update.

slapsys commented Oct 17, 2014

This is ones I use.

# JAVA
setenv JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home
setenv JAVA7_HOME /Library/Java/JavaVirtualMachines/1.7.0/Contents/Home
setenv JAVA8_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home

# Android
setenv ANDROID_HOME <path-to-sdk>/android_sdk
setenv ANDROID_SDK <path-to-sdk>/android_sdk

It worked till Yosemite update.

@yzp531

This comment has been minimized.

Show comment
Hide comment
@yzp531

yzp531 Jun 4, 2015

like this

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

retrolambda {
jdk "C:/Java8/jdk1.8.0_45"
oldJdk "C:/Java/jdk1.7.0_71"
javaVersion JavaVersion.VERSION_1_7

println("***************** ---------- *******************")
println("JAVA_HOME: " + System.getenv("JAVA_HOME"))
println("JAVA7_HOME: " + System.getenv("JAVA7_HOME"))
println("JAVA8_HOME: " + System.getenv("JAVA8_HOME"))
println("***************** ---------- *******************")

}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
lintOptions {
    disable 'InvalidPackage'
    abortOnError false
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies {
compile 'com.android.support:support-v4:21.+'
compile 'io.reactivex:rxjava:1.0.+'
/* compile 'io.reactivex:rxandroid:0.23.+'*/
compile 'com.squareup.retrofit:retrofit:1.8.+'
compile 'com.squareup.okio:okio:1.1.+'
compile 'com.squareup.okhttp:okhttp:2.1.+'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.+'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@jar'
compile 'io.reactivex:rxandroid:0.24.0'
}

yzp531 commented Jun 4, 2015

like this

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

retrolambda {
jdk "C:/Java8/jdk1.8.0_45"
oldJdk "C:/Java/jdk1.7.0_71"
javaVersion JavaVersion.VERSION_1_7

println("***************** ---------- *******************")
println("JAVA_HOME: " + System.getenv("JAVA_HOME"))
println("JAVA7_HOME: " + System.getenv("JAVA7_HOME"))
println("JAVA8_HOME: " + System.getenv("JAVA8_HOME"))
println("***************** ---------- *******************")

}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
lintOptions {
    disable 'InvalidPackage'
    abortOnError false
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies {
compile 'com.android.support:support-v4:21.+'
compile 'io.reactivex:rxjava:1.0.+'
/* compile 'io.reactivex:rxandroid:0.23.+'*/
compile 'com.squareup.retrofit:retrofit:1.8.+'
compile 'com.squareup.okio:okio:1.1.+'
compile 'com.squareup.okhttp:okhttp:2.1.+'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.+'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@jar'
compile 'io.reactivex:rxandroid:0.24.0'
}

@toughrogrammer

This comment has been minimized.

Show comment
Hide comment
@toughrogrammer

toughrogrammer Jun 24, 2015

It was really helpful.....

toughrogrammer commented Jun 24, 2015

It was really helpful.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment