错误:compileSdkVersion的android-21需要与JDK 7编译 [英] Error:compileSdkVersion android-21 requires compiling with JDK 7

查看:212
本文介绍了错误:compileSdkVersion的android-21需要与JDK 7编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编译时出现错误错误:compileSdkVersion的android-21需要与JDK 7编译,说JDK的更新版本,需要

While compiling i get the error Error:compileSdkVersion android-21 requires compiling with JDK 7, saying that a newer version of JDK is required.

我在OS X上运行的优胜美地与Android工作室v0.8.14

I'm running on OS X Yosemite with Android Studio v0.8.14

东西:

  1. Java版本:

Java版本1.8.0_25 的Java(TM)SE运行时环境(建设1.8.0_25-B17) Java的热点(TM)64位服务器虚拟机(建设25.25-B02,混合模式),

java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

在JavaVirtualMachine文件夹,我只能看到 1.6.0.jdk 文件夹,我找不到任何其他文件夹。

  1. Inside the JavaVirtualMachine folder I can see only 1.6.0.jdk folder, I cannot find any other folder.

尝试重新安装JDK 8和7!

Tried reinstalling JDk 8 and 7!

我无法找到JVM 1.8的文件夹位置,任何想法如何,我可以解决那里。

I'm unable to find the folder location of jvm 1.8, any idea how I can fix there.

推荐答案

的精确修复此问题(Android的工作室Mac用户)

如果您已经升级到Java 8,请注意JDK的位置现在是在 /库/ Java的相比,Java 6的位置 /系统/库/ Java的。因此,要解决此问题,右键点击<大骨节病> Project文件夹> <大骨节病>项目结构> <大骨节病> SDK位置。

If you have already upgraded to Java 8, please note that the JDK location is now within /Library/Java compared to Java 6's location /System/Library/Java. So to fix this problem, Right click on the Project folder > Project Structure > SDK Location.

然后换JDK位置

/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

如果您已经安装了一个不同的JDK版本(不是Java 8等),找出使用 JAVA_HOME 脚本路径优先和使用的输出。只要运行,

If you have installed a different JDK version (other than Java 8), find out the path using the java_home script first and use the output. Just run,

/usr/libexec/java_home 

这篇关于错误:compileSdkVersion的android-21需要与JDK 7编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆