简体   繁体   English

更新Java和JRE在Eclipse中引起许多错误

[英]Updating Java and JRE are causing many errors in Eclipse

I'm using Eclipse to program Android applications, and when I opened the program yesterday, it popped up an error saying I need to install JRE - I've downloaded the JRE and installed it - when during the installation I got a message saying that the JAVA version I have on the computer (Version 7) is too old for the JRE (Version 8), and that I need to update the JAVA also. 我正在使用Eclipse对Android应用程序进行编程,昨天打开该程序时,它弹出一个错误,提示我需要安装JRE-我已经下载并安装了JRE-在安装过程中,我收到一条消息,提示您我在计算机上使用的JAVA版本(版本7)对于JRE(版本8)而言过旧,并且我还需要更新JAVA。 I did so, and then opened up the Eclipse again - And all of the projects,that before worked great, are now full with errors. 我这样做了,然后再次打开Eclipse-所有以前运行良好的项目现在都充满了错误。 I tried installing all of the SDK updates - didn't work, also tried uninstalling Eclipse and re-install it - also didn't work. 我尝试安装所有SDK更新-无效,还尝试卸载Eclipse并重新安装-也无效。

The errors I get are: "XXX cannot be resolved to a type" - in amost every single line in the project. 我得到的错误是:“ XXX无法解析为类型”-在项目的几乎每一行中。

How do I fix it?? 我如何解决它?? Thank you!! 谢谢!!

安装android开发工具(adt)..并全部更新SDK,然后导入旧程序。

I would suggest to check that your java build path is functioning properly. 我建议检查您的Java构建路径是否正常运行。 This kind of error for me usually means that eclipse cannot find the JRE installation. 对我来说,这种错误通常意味着eclipse无法找到JRE安装。

Form eclipse you can go to Project->Properties and check for any errors there. 月蚀你可以去Project->Properties并检查那里的任何错误。 Any inconsistency there would cause all your projects to fail. 那里的任何不一致都会导致您所有的项目失败。

First of all, you need the JDK installation, not JRE. 首先,您需要JDK安装, 而不是 JRE。 Second, Android currently supports up to Java v7, which means you'll need to get JDK v7 from here . 其次,Android当前最多支持Java v7,这意味着您需要从此处获取JDK v7。 Make sure you download the correct 32-bit or 64-bit JDK version for your operating system. 确保为您的操作系统下载了正确的32位或64位JDK版本。

Also, ensure your Android SDK and Android Development Tools (ADT) are on the same released version. 另外,请确保您的Android SDK和Android开发工具(ADT)使用相同的发行版本。 Different versions of Android SDK and ADT can lead to many unforseen problems. 不同版本的Android SDK和ADT可能会导致许多无法预料的问题。

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

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