0
votes

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.

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]'.

How can I fix this issue?

1
You need Eclipse 2019-06 for full Java 12 support, Mars is far too old.greg-449
Welcome to Stack Overflow! A request for clarification: has your question been fully answered? If so, please consider accepting an answer. Doing so helps future readers to determine if the problem is solved, and shows appreciation for the people who took the time answering you. Otherwise please provide feedback, so that people can further adjust their answers.GhostCat

1 Answers

3
votes

Look at this:

This marketplace solution provides Java 12 support for Eclipse 2019-03 (4.11). To install the feature, please ensure you have the 4.11 version of Eclipse IDE installed:

Typically, such marketplace entries exist to enable a newer Java with some older version of eclipse.

Note: it says you need eclipse version 4.11.

Mars version number is 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). And as user greg correctly points out, eclipse 4.12 supports Java 12 out of the box. 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.

Keep in mind: eclipse has its own compiler. It offers syntax support for new language features, it probably has special handling for new "things" inside java. Even if you could somehow get Mars to work with Java 12, most likely, that would be a dirty hack.

As said: consider your idea to be a waste of time. Go, get the latest version of eclipse, and use that.

( Or, my personal two cent: if you only care about Java development, go get the latest version of IntelliJ, and forget about eclipse )