Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [SOLVED] Eclipse 20-12 and 21-03 Java 16(Eclipse 20-12 and 21-03 not compatible with Java 16)
[SOLVED] Eclipse 20-12 and 21-03 Java 16 [message #1836829] Fri, 15 January 2021 03:16 Go to next message
Michael Davies is currently offline Michael DaviesFriend
Messages: 7
Registered: August 2015
Location: Australia
Junior Member
My understanding was that 20-12 would recognise Java 15 and 21-03 would recognise Java 16. I appreciate 21-03 is still under development but I thought this functionality was already available.
Java 16 is not selectable as a compliance level in Eclipse. Java 15 is ok but it is not compatible with source code from Java 14 with preview features enabled. Derived objects which extend Java Objects do not have access to the parent variables. I believe this java behaviour is related JEP305 Pattern matching but was supposed to be fixed in Java16; hence my interest in using Java 16.
I give below 2 examples of pattern matching and the errors. The Button is an object which extends JButton but is not recognised. It had no problem in Java 14 with preview features enabled.

if ((c1 instanceof Button b) && (c1.getName() == "close")) {

if (tmpObject instanceof Button b) {
if (b.getText().contains("close"){

I would appreciate hearing about your experience, in particular how to get Java 16 recognised by Eclipse. I cannot find any plugins although I have installed https://download.eclipse.org/eclipse/updates/4.19-P-builds


Thank You
Mike

[Updated on: Mon, 25 January 2021 00:33]

Report message to a moderator

Re: Eclipse 20-12 and 21-03 Java 16 [message #1836833 is a reply to message #1836829] Fri, 15 January 2021 05:02 Go to previous messageGo to next message
Manoj N Palat is currently offline Manoj N PalatFriend
Messages: 19
Registered: October 2014
Junior Member
Hi,
> Quote:
My understanding was that 20-12 would recognise Java 15 and 21-03 would recognise Java 16.

20-12 recognizes Java 15. You will need to install Java 16 support from marketplace on top of 21-03 to recognize Java 16.

> I appreciate 21-03 is still under development but I thought this functionality was already available.

Continuing from above, Java 16 is developed as a separate branch BETA_JAVA16 and is still under development. If you want to try this out you can update to Y build [https://download.eclipse.org/eclipse/updates/4.19-Y-builds/]. However, *repeat* this is *not* production code - still under development.

>Java 16 is not selectable as a compliance level in Eclipse.
For the reasons stated above, no - it is not yet available.

> Java 15 is ok but it is not compatible with source code from Java 14 with preview features enabled.
preview features are always tied to a particular release and compatibility is not guaranteed as per java documentation

>Derived objects which extend Java Objects do not have access to the parent variables. I believe this java behaviour is related JEP305 Pattern matching but was supposed to be fixed in Java16; hence my interest in using Java 16.

Please file bugs against Eclipse JDT Core for these -
we will analyze them.[https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT]

I give below 2 examples of pattern matching and the errors. The Button is an object which extends JButton but is not recognised. It had no problem in Java 14 with preview features enabled.

if ((c1 instanceof Button b) && (c1.getName() == "close")) {

if (tmpObject instanceof Button b) {
if (b.getText().contains("close"){

> I would appreciate hearing about your experience, in particular how to get Java 16 recognised by Eclipse. I cannot find any plugins although I have installed https://download.eclipse.org/eclipse/updates/4.19-P-builds


Hope the Y build part answers your query.

Regards,
Manoj


Manoj N Palat
Eclipse Java Development Tools (JDT).
Re: Eclipse 20-12 and 21-03 Java 16 [message #1836834 is a reply to message #1836833] Fri, 15 January 2021 05:14 Go to previous messageGo to next message
Manoj N Palat is currently offline Manoj N PalatFriend
Messages: 19
Registered: October 2014
Junior Member
Hi,
Please note that the replies are inlined inside the quote.
sorry for the formatting.

Regards,
Manoj


Manoj N Palat
Eclipse Java Development Tools (JDT).
Re: Eclipse 20-12 and 21-03 Java 16 [message #1837203 is a reply to message #1836834] Sun, 24 January 2021 23:21 Go to previous messageGo to next message
Michael Davies is currently offline Michael DaviesFriend
Messages: 7
Registered: August 2015
Location: Australia
Junior Member
Thanks Manoj,
The Y release solved the problem of accessing Java 16 but I now have a stranger problem.
All my inner classes do not have access to the outer class members. I gave examples earlier.
I looked at my production machine which only contains Eclipse 20-03 and JDK14 and was working fine last time I used it. Now it has plenty of Red error markers in the vertical rulers. The really strange thing is the error markers do not appear in the Package Explorer as they normally would!
The only thing I may have changed on my production machine is to do a regular update on Eclipse 20-03.
This really has me stumped. I will search my backups to see if I have a pre-update 20-03 version.
Regards
Mike


Thank You
Mike
Re: Eclipse 20-12 and 21-03 Java 16 [message #1837204 is a reply to message #1837203] Mon, 25 January 2021 00:31 Go to previous message
Michael Davies is currently offline Michael DaviesFriend
Messages: 7
Registered: August 2015
Location: Australia
Junior Member
Solved my own problem. The one project I selected for testing had an incorrect build path. Other development modules I was using were included in "Projects/ModulePath" and should have been in "Projects/Classpath". All other projects I am working on were correct and worked ok under Java!6. I don't know how this one project got out of sync

Thank You
Mike
Previous Topic:Eclipse broke on Mac OS X - need help
Next Topic:Eclipse's internal browser seems to identify as Internet Explorer
Goto Forum:
  


Current Time: Fri Apr 26 17:47:48 GMT 2024

Powered by FUDForum. Page generated in 0.03187 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top