Hi Scott,
we build against both JDK 8 and JDK 11 versions and manage the JAXB issue by 
adding this to our Maven pom.xml

        <!-- Required for JDK11+ -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <scope>runtime</scope>
        </dependency>

Hope this helps.
________________________________
From: Scott Palmer <swpal...@gmail.com>
Sent: 28 January 2022 2:57 PM
To: NetBeans Mailing List <users@netbeans.apache.org>
Cc: Tom Eicher <teic...@teicher.net>; Thomas Wolf <tjw...@gmail.com>
Subject: Re: JDK 8 vs 11 JAXB problem

Yes it was Java 11.  It was a bit of a disaster how they dropped JAXB.

It was a JPMS module in JDK 10, and then suddenly that wasn’t possible - you 
couldn’t get it back by using jlink to build a JRE that looked like the one 
from JDK 10.  I can’t remember exactly which jar it was but basically it became 
de-modularized as far as jlink is concerned.  So a step backwards that Oracle 
didn’t seem to be concerned with. Not to mention the fact that the package 
names change if you want to upgrade to newer versions - so even if the jakarta 
people have finally got around to making it modular again (they didn’t seem to 
care either), you can’t drop the modules in and have things work.  I 
unfortunately had a large project made from over a hundred independently 
developed plugins making it very difficult to manage.

So you have to add old versions of JAXB to the classpath to move to JDK 11 or 
beyond unless you can refactor your project to the new packages.

Scott

On Jan 28, 2022, at 9:08 AM, Thomas Wolf 
<tjw...@gmail.com<mailto:tjw...@gmail.com>> wrote:

I think JAXB stopped being included with the JDK somewhere around JDK 11.  You 
should find the JAXB jar files on the ’net (I got them from maven central) and 
include them in your project’s class path .  At least that’s what I did - I 
also have an ant based project.  The files I use for all my JAXB-related code 
are (some are run-time, not build-time required):
jaxb-impl-3.0.2.jar
jakarta.activation-2.0.1.jar
jakarta.xml.bind-api-4.0.0-RC2.jar
jaxb-core-3.0.2.jar

Hope this helps.
Tom


On Jan 28, 2022 at 6:00:53 AM, Tom Eicher 
<teic...@teicher.net<mailto:teic...@teicher.net>> wrote:
Hello,

I'm back to my problem that has hindered me updating to
any Netbenas after 8.2...

My Application (ear, ejb, war) is still on JDK 8 with
an ant build.

When I start NB 12.6 with JDK8 runtime, all is fine with
the application.
But I can't edit; the editor has strange behaviour and
reports show a missing method CharBuffer.flip()
(just sent a problem report from NB)

When I start NB 12.6 with JDK11 runtime, all is fine with
NB and editors.
But I can't compile:
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
in the ant build.

So I add JDK8 as a NB platform, and change my project
to use JDK8 ... but this seems not to affect the ant
build. It still breaks. Seems the ant build does not
respect JDK platform setting?

Ideas welcome.

Thanks Tom.

Reply via email to