You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Tom Eicher <te...@teicher.net> on 2022/01/28 11:00:53 UTC

JDK 8 vs 11 JAXB problem

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.





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: JDK 8 vs 11 JAXB problem

Posted by Tom Eicher <te...@teicher.net>.
Thanks for your input everybody!

I was hoping I could just tell NB to run the ant command with
the Java8 JAVA_HOME or any of those variables or properties.

I also tried modifying the bin/ant in
NetBeans/netbeans/extide/ant
to get an export JAVA_HOME
but nothing helped.

So got the 4 jars from mavencentral and added them as
"required in runtime=no" libraries.

This works fine. The jenkins build, using Java8 now has
has warnings about those libraries, from stray entries
in the ant scripts, created by NB, but it doesn't break
the build so that's ok for now...

Cheers Tom.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: JDK 8 vs 11 JAXB problem

Posted by Thomas Wolf <tj...@gmail.com>.
 He’s using ant.
tom


On Jan 28, 2022 at 10:02:03 AM, Lister Jonathan <jo...@vaisala.com>
wrote:

> 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 <sw...@gmail.com>
> *Sent:* 28 January 2022 2:57 PM
> *To:* NetBeans Mailing List <us...@netbeans.apache.org>
> *Cc:* Tom Eicher <te...@teicher.net>; Thomas Wolf <tj...@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 <tj...@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 <te...@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.
>
>

Re: JDK 8 vs 11 JAXB problem

Posted by Lister Jonathan <jo...@vaisala.com>.
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 <sw...@gmail.com>
Sent: 28 January 2022 2:57 PM
To: NetBeans Mailing List <us...@netbeans.apache.org>
Cc: Tom Eicher <te...@teicher.net>; Thomas Wolf <tj...@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 <tj...@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 <te...@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.

Re: JDK 8 vs 11 JAXB problem

Posted by Scott Palmer <sw...@gmail.com>.
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 <tj...@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 <teicher@teicher.net <ma...@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.

Re: JDK 8 vs 11 JAXB problem

Posted by Thomas Wolf <tj...@gmail.com>.
 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 <te...@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.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>