6

I have downloaded and installed jdk 1.8, but when i try to set path to jdk 1.8 in ProjectStructure -> JDK Location, AndroidStudio ignored it, so after set path enter image description here click OK and reopen window "ProjectStructure" i see jdk 1.7 again enter image description here

Werder
  • 383
  • 2
  • 4
  • 16
  • Did you try to resolve the error shown in the bottom? Maybe it doesn't accept new settings if you do not change this? – Bernhard Aug 22 '16 at 10:55
  • @Bernhard, No, this warning is useless, AS worked fine before i update buildTools to 24.0.1 – Werder Aug 22 '16 at 11:00

7 Answers7

5

I deleted folder with java 1.7, and AndroidStudio open me dialog for specifing jdk-path, whehe i set it. Thank everybody for answering!

Werder
  • 383
  • 2
  • 4
  • 16
  • It works ! thanks @Werder. note: you should install JDK 1.8 first, you must **delete** not just rename the java 1.7 folder – jajamaharaja Sep 09 '16 at 02:46
3

This seems to be a bug either in Android Studio 2.1.x or IntelliJ. Here is a workaround after you installed the new JDK and set it as JAVA_HOME env variable:

  1. Close Android Studio
  2. Go to %HOME%/.AndroidStudio2.1/config/options (or which version you are using)
  3. rename/delete jdk.table.xml
  4. start Android Studio again -> the JDK set in JAVA_HOME should be set as default jdk

Reference: https://code.google.com/p/android/issues/detail?id=213239

See also: Android Studio JDK location changes back to 1.7 every time it is updated to 1.8 path

Community
  • 1
  • 1
Patrick
  • 33,984
  • 10
  • 106
  • 126
1

Uninstall Java JDK7 and install JDK8, or set JDK8 as default Java VM in your OS.

AndroidDev
  • 11
  • 1
0

I think you need to update your path variable and add your jdk location to it . Studio must be automatically getting path from your environment variable and replacing your path .

Devansh Kumar
  • 1,552
  • 1
  • 15
  • 27
0

The JDK 1.8 does not seem to be fully supported by Android Studio because the Android platform does not support Java 8 as it is currently.

You can see this link for more information. Is JDK 1.8 fully supported by Android Studio?

Community
  • 1
  • 1
Miro
  • 97
  • 3
  • No, i use AndroidStudio 2.1.3, and i have error: Error:Buildtools 24.0.1 requires Java 1.8 or above. Current JDK version is 1.7. – Werder Aug 22 '16 at 10:49
  • There might be an other issue then. Buildtools 24.0.1 should not require Java 8. Looks like preview version of Android N has support for Java 8 https://developer.android.com/preview/j8-jack.html Could you add your gradle files for debugging reference? – Miro Aug 22 '16 at 10:52
0

use Android Studio 2.2 preview 7 version this only support java 8

Then you can use java 8 features :)

Nitesh Pareek
  • 362
  • 2
  • 10
0

Just move your sdk folder to the small destination folder like C:/sdk. It seems that without setting your sdk folder you can't change the directory of the jdk folder.