4

Android studio - updated sdk with android 21 , updated java to 1.7.0 . Whenever i try to compile with android L ( 21 ) , it throws this error and gradle sync is failed.

C:\Users\me>java -version java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

found similar question for mac - Android Studio needs JDK 7 for Android-L mac

asked Nov 6, 2014 at 5:51

1 Answer 1

8

You have two options, you can just switch your compiled version back to 20 if you do not want all the goodness of SDK 21. To upgrade to JDK 7 for Windows, do this:

  1. Download the Jave 7 exe from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
  2. Perform a straight forward install and take note of the installation folder such as C:\Program Files\Java\jdk1.7.0_71
  3. Then click on File> Project Structure and point the JDK location to the location of the JDK you just installedenter image description here
answered Nov 17, 2014 at 19:18
1
  • In Ubuntu 14.04 a valid path for "JDK location" is "/usr/lib/jvm/java-7-openjdk-amd64". I say "a valid path" because you can find simlinks to the same location that probably work too. I don't sure about Oracle JDK path. Commented May 23, 2015 at 5:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.