Eclipse compatibility with Java updates [message #1784601] |
Fri, 30 March 2018 00:05  |
Eclipse User |
|
|
|
A few days ago I installed Java 10 and Eclipse 4.7.3.
I was not wanting to use any features of Java 10, just Java 9.
I used the -clean option when I started Eclipse and everything seemed fine.
I continued with my development and executed the program I was working on using both the "Run as" popup menu option and the "Run" button.
Today I was working on a different program in the same workspace but the drop down menu for the "Run" button didn't include the configuration for the program I wanted to run. So I opened the "Run Configurations" dialog.
This was when I discovered that I could not use it to run any program as it was reporting "JRE not compatible with workspace .class file compatibility: 9". The "Run" button on the dialog remained greyed out.
Opening the "Execution Environments" tab in preferences shows absolutely no compatible JREs for any environment. So Eclipse must think that a standard JDK 10 install is not compatible with anything.
Back to the Run Configurations dialog. Selecting the JRE tab and the "Execution Environment" option enables the combo box. However all but JavaSE-1.8 are unbound and the JavaSE-1.8 environment is bound to the installed JRE!
So Eclipse thinks that the standard JDK 10 is not compatible with any execution environment, but also that it is compatible with JavaSE-1.8.
I expected there to be no problems using Java 10 whilst working on Java 9 code.
(Given the major upheaval in Eclipse due to Java 9 maybe I should have.)
Should I have expected a compatibility issue like this with the upgrade to Java 10?
Should I also expect issues like this with future upgrades?
I think the inconsistent behaviour of Eclipse may not be worth fixing/reporting as I can still execute programs.
Namaste, Bruce
|
|
|
|
|
Re: Eclipse compatibility with Java updates [message #1784639 is a reply to message #1784628] |
Sat, 31 March 2018 10:16   |
Eclipse User |
|
|
|
Regarding the specific timing of your question: we have finalized Java 10 support for the 4.7.3a release (scheduled to go public on Apr. 11) just now. Until that release a few rough edges are not only to be expected, but Eclipse lives from the feedback of its users during development. In this regard you are more than welcome to report issues with unreleased features directly into bugzilla (well, looking for existing reports of the same issue is of course highly appreciated :) ).
As for predicting future Java versions, you may recall that Java 10 was originally announced as "18.3", only later renamed to "10". Since we never knew how to detect compatibility of future versions, JDT has a tradition of waiting until a new version is (about to be) released, before we recognize it as compatible. It is a valid point - already being discussed - whether from now on recognizing Java versions should apply the announced scheme of future Java versions, rather then relying on a fixed set of known versions.
I'm not 100% sure what you mean by "letting the JVM make the decision". There is no way of asking a JVM "are you compatible with Java 9" or such. Moreover, JDT needs to be able to read .class files. If we are presented with a class file from a version that JDT does not understand, there can be no guarantee that the tooling will "just work". In some cases it can't.
As you mention Java 9 in particular, maybe we should even raise a much stronger warning when working on Java 8 projects using JDK 9, because chances are that the Java 8 program will *not* run out-of-the-box on JDK 9 ;-p
cheers,
Stephan
|
|
|
|
Powered by
FUDForum. Page generated in 0.07176 seconds