Eclipse 2020-12 issues with javax packages [message #1836190] |
Wed, 23 December 2020 11:17  |
Eclipse User |
|
|
|
I updated my Eclipse to 2020-12 and after it my workspace projects has "erros" to import javax packages.
I've a custom Target Plataform with jakarta.xml.bind-api_2.3.2.jar library included. Then to use it, I imported the package javax.xml.bind on MANIFEST.MF without version:
Import-Package: javax.xml.bind,
....
My java code import it and it always works fine:
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
....
But, after updated to 2020-12, the imports has an error:
The import javax.xml.bind cannot be resolved
If I change my package dependecy to:
javax.xml.bind;version="2.3.2"
The java import works again.
I've the same problem with others javax packages...
I've 50 bundles that this problem and change each bundles is a bad way to me. This product is in Production Env to 3 years and change each bundle wiil be require a lot of tests.
How I solved it without specifique a version of javax packages on manifest?
|
|
|
Re: Eclipse 2020-12 issues with javax packages [message #1836197 is a reply to message #1836190] |
Wed, 23 December 2020 15:33   |
Eclipse User |
|
|
|
Hi
This has been a mega-pain ever since Java became totally unstable with the introduction of modules in Java 9 and now made even worse by the effective removal of Eclipse support for the not-EOL Java 8.
See https://www.eclipse.org/lists/cross-project-issues-dev/msg16293.html in which I wrote
Quote:The recent "Errors when running 2018-12 RC2 on Java 11" thread is just one of many 'new'-Java problems.
The instability of Java is clearly a major PITA, so that each of Java 8, 9, 10, 11 has resulted in significant breakages that have gradually been ameliorated.
As a user I see Eclipse as a nice platform that has for many years hidden the Windows/Linux/MacOS eccentricities. Less obviously, the platform now needs to hide the Java 7/8/9/10/11 eccentricities, so that for the most part an Eclipse application just works. We should not depend on each project rebuilding with latest-Java workarounds.
Currently each new Java eccentricity seems to be accommodated by dubious workarounds that do not hide the problem from the user. e.g. I now have to import javax.annotation into each of my test plugins.
It seems that we need to offer two options.
a) a default Eclipse that maximally hides the Java eccentricities to give a good user experience. This may require a 're-modularizer' to counteract Java's incessant migrations.
b) -strict Eclipse for those who want to be precisely in tune with a Java eccentricity.
This obvservation/suggestion seemed well received in principle, but there is always the problem of resources/funding, so Eclipse prefers to require each user/developer to discover/diagnose/accommodate each new Java instability.
In the case of your 50 changes, I suggest introducing a common dependency that acquires javax etc so that next time you only need to make a change in one place.
Regards
Ed Willink
|
|
|
|
Powered by
FUDForum. Page generated in 0.06327 seconds