简体   繁体   English

JDK 1.7未显示在Program Files文件夹中

[英]JDK 1.7 not shown in Program Files folder

I have started developing an Android application in Android Studio. 我已经开始在Android Studio中开发Android应用程序。 After starting Android Studio it gives me an error: "compileSdkVersion android-21 requires compiling with JDK 7". 启动Android Studio后,它给我一个错误:“ compileSdkVersion android-21要求使用JDK 7进行编译”。 So I ran java -version at the Commmand Prompt and it shows I have 1.7. 所以我在Commpand Prompt上运行了java -version ,它显示我有1.7。 But in Program Files there is a folder for JDK 1.6 but not for 1.7. 但是在“程序文件”中,有一个用于JDK 1.6的文件夹,而不是用于1.7的文件夹。 JRE of 1.7 is there, but not JDK 1.7. 有1.7的JRE,但没有JDK 1.7。

Any suggestions will be appreciated. 任何建议将不胜感激。 Thanks in advance. 提前致谢。

Try "javac -version" instead of "java -version" to confirm JDK installed version 尝试使用“ javac -version”而不是“ java -version”来确认JDK的安装版本

It seems that you have a 1.7 Java Runtime but only 1.6 SDK installed. 看来您安装了1.7 Java Runtime,但仅安装了1.6 SDK。

Just get the correct SDK installer from java.com. 只需从java.com获得正确的SDK安装程序。

new: Idea is you can simply set you projects jdk any version you want, different from os installed one, just make sure you download it and referenece from the android studio Same story different interfaces, donno if downvotes were necesary 新增内容:想法是您可以简单地将项目jdk设置为所需的任何版本(不同于os安装的版本),只需确保从android studio下载并引用即可。

https://askubuntu.com/questions/467870/how-to-set-the-jdk-for-android-studio https://askubuntu.com/questions/467870/how-to-set-the-jdk-for-android-studio

androidstudio set java version 1.7 androidstudio设置java版本1.7

old(sry tought is eclipse): 旧的(Sry Tought蚀):

How to change JDK version for an Eclipse project 如何为Eclipse项目更改JDK版本

And make sure you have jdk available for eclipse to set it incase you dotn have it. 并确保您有可用于Eclipse的jdk来设置它,以防您点到它。 Else just change type 否则只需更改类型

Uninstall all jres and jdks, reinstall the jdk you need (jre is included). 卸载所有jres和jdks,重新安装所需的jdk(包括jre)。 Be carefull with the bit-versions, always install the correct one 小心位版本,始终安装正确的版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM