简体   繁体   English

如何更新Eclipse以使用Java的更新版本?

[英]How to update Eclipse to use the updated version of Java?

So on my computer i have Java 8 downloaded and when i check java preferences i am given the upload path and location. 因此,在我的计算机上,我下载了Java 8,当我检查Java偏好设置时,便获得了上传路径和位置。 But since my Eclipse is still runing on Java 6 i wanted to update it to Java 8. So i went to Eclipse preferences then java preferences then clicked on Installed JREs. 但是由于我的Eclipse仍在Java 6上运行,所以我想将其更新为Java8。因此,我先选择了Eclipse首选项,然后再选择Java首选项,然后单击Installed JRE。 And I pressed add, then standard vm and for the jre home i put /Library/Internet Plug-Ins/(Etc) until it was all pasted. 然后按添加,然后按标准vm,然后为jre home放置/ Library / Internet Plug-Ins /(Etc),直到全部粘贴为止。 but the box still says "Target is not a JDK Root. Java executable was not found". 但该框仍显示“目标不是JDK根。找不到Java可执行文件”。 Is there some step that i did was wrong, or whats the proper way to do it? 我做错了什么步骤,或者正确的方法是什么? Thanks so much in advance 提前非常感谢

Windows computer you need to update from java directly. 您需要直接从Java更新Windows计算机。 Normally an icon would tell you to update. 通常,一个图标会告诉您进行更新。 Or you can install java 8 或者您可以安装Java 8

Step by step: 一步步:

Download and Install 下载并安装

This process requires you to download an executable file that includes all the files needed for the complete installation. 此过程要求您下载一个可执行文件,其中包括完整安装所需的所有文件。 You do not need to remain connected to the Internet during the installation. 在安装过程中,您无需保持与Internet的连接。 The file can also be copied to a computer that is not connected to the Internet. 也可以将文件复制到未连接到Internet的计算机上。

Go to the Manual download page Click on Windows Offline. 转到“手动下载”页面单击Windows脱机。 The File Download dialog box appears prompting you to run or save the download file Click Save to download the file to your local system. 出现“文件下载”对话框,提示您运行或保存下载文件。单击“保存”将文件下载到本地系统。 Tip: Save the file to a known location on your computer, for example, to your desktop. 提示:将文件保存到计算机上的已知位置,例如,保存到桌面。 Close all applications including the browser. 关闭所有应用程序,包括浏览器。 Double-click on the saved file to start the installation process. 双击保存的文件以开始安装过程。 The installation process starts. 安装过程开始。 Click the Install button to accept the license terms and to continue with the installation. 单击安装按钮以接受许可条款并继续安装。

Now to point java to system path variable: 现在将java指向系统路径变量:

Select Computer from the Start menu Choose System Properties from the context menu Click Advanced system settings > Advanced tab Click on Environment Variables, under System Variables, find PATH, and click on it. 从“开始”菜单中选择“计算机”,从上下文菜单中选择“系统属性”,然后单击“高级系统设置”>“高级”选项卡。单击“环境变量”,在“系统变量”下,找到PATH,然后单击它。 In the Edit windows, modify PATH by adding the location of the class to the value for PATH. 在“编辑”窗口中,通过将类的位置添加到PATH的值来修改PATH。 If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value. 如果没有PATH项,则可以选择添加一个新变量,并将PATH作为名称添加,将类的位置作为值添加。 Reopen Command prompt window, and run your java code. 重新打开命令提示符窗口,然后运行您的Java代码。

And after that eclipse should be able to detect it automatically 在那次蚀之后应该能够自动检测到它

The download from java.com which installs in /Library/Internet Plug-Ins is only the JRE, for development you probably want to download the JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html and install that instead. 安装在/ Library / Internet插件中的java.com上的下载仅是JRE,对于开发而言,您可能想从http://www.oracle.com/technetwork/java/javase/downloads/index下载JDK 。 .html并安装它。 This will install the JDK at /Library/Java/JavaVirtualMachines/jdk1.7.0_.jdk/Contents/Home which you can then add to Eclipse via Preferences -> Java -> Installed JREs. 这会将JDK安装在/Library/Java/JavaVirtualMachines/jdk1.7.0_.jdk/Contents/Home中,然后可以通过“首选项”->“ Java”->“已安装的JRE”将其添加到Eclipse。

Learned after research it should help 研究后了解到它应该有所帮助

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

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