简体   繁体   English

如何从Java 12.0.2向Eclipse Mars 4.5.2添加jre

[英]how do I add jre from java 12.0.2 to eclipse mars 4.5.2

I recently installed java jdk 12.0.2 and eclipse on my windows 10 laptop and I am not able to add the JRE library to Eclipse Mars.2 4.5.2. 我最近在Windows 10笔记本电脑上安装了Java jdk 12.0.2和eclipse,但无法将JRE库添加到Eclipse Mars.2 4.5.2。

I've tried adding the library through the build path but I keep getting error saying 我尝试通过构建路径添加库,但是我一直收到错误消息

Unbound classpath container: 'JRE System Library [JavaSE-1.8]'. 未绑定的类路径容器:“ JRE系统库[JavaSE-1.8]”。

How can I fix this issue? 如何解决此问题?

Look at this : 这个

This marketplace solution provides Java 12 support for Eclipse 2019-03 (4.11). 此市场解决方案为Eclipse 2019-03(4.11)提供Java 12支持。 To install the feature, please ensure you have the 4.11 version of Eclipse IDE installed: 要安装该功能,请确保已安装4.11版本的Eclipse IDE:

Typically, such marketplace entries exist to enable a newer Java with some older version of eclipse. 通常,存在这样的市场条目以使用较版本的eclipse来启用更新的Java。

Note: it says you need eclipse version 4.11. 注意:它表示您需要Eclipse版本4.11。

Mars version number is 4.5 . 火星版本号为4.5 (4.11 is the version of eclipse that was released in March 19, there is only one newer version, 4.12 from June 2019). (4.11是3月19日发布的eclipse版本,只有一个新版本,即2019年6月的4.12)。 And as user greg correctly points out, eclipse 4.12 supports Java 12 out of the box. 正如用户greg正确指出的那样,Eclipse 4.12开箱即用地支持Java 12。 Which again underlines my point: when you want to use the latest greatest language versions, use the latest greatest tool versions. 这再次强调了我的观点:当您要使用最新的最佳语言版本时,请使用最新的最佳工具版本。

In other words: forget about it. 换句话说:算了吧。 Do not waste a single second trying to convince a 4 year old version of eclipse to run with a brand new Java. 不要浪费任何时间试图说服4年版本的eclipse与全新的Java一起运行。

Keep in mind: eclipse has its own compiler. 请记住:eclipse有自己的编译器。 It offers syntax support for new language features, it probably has special handling for new "things" inside java. 它提供了对新语言功能的语法支持,它可能对Java内部的新“事物”进行了特殊处理。 Even if you could somehow get Mars to work with Java 12, most likely, that would be a dirty hack. 即使您能以某种方式使Mars与Java 12一起工作,也很可能是肮脏的黑客。

As said: consider your idea to be a waste of time. 如前所述:认为您的想法浪费时间。 Go, get the latest version of eclipse, and use that. 开始,获取最新版本的eclipse,然后使用它。

( Or, my personal two cent: if you only care about Java development, go get the latest version of IntelliJ, and forget about eclipse ) (或者,我个人的两分钱:如果您只关心Java开发,请获取IntelliJ的最新版本,而不必担心eclipse)

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

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