You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mingwan Kim <to...@gmail.com> on 2023/06/29 15:38:38 UTC

[configurations] 2.9.0 throws NoSuchMethodException on JDK 1.8

Hello,

A breaking API change in JDK 9 causes NoSuchMethodException when
commons-configurations 2.9.0 runs on JDK 1.8 (check the example
https://github.com/tolskais/configurations_1.8).
Is commons-configuration2 intended not to support JDK 1.8 or just a bug?

Thanks,
Mingwan Kim

Re: [configurations] 2.9.0 throws NoSuchMethodException on JDK 1.8

Posted by Mingwan Kim <to...@gmail.com>.
I checked that the local commons-configurations built with the maven
property maven.compiler.release=8 does not throw the exception.

2023년 6월 30일 (금) 오전 7:31, Mingwan Kim <to...@gmail.com>님이 작성:

> I just checked that the example does not throw NoSuchMethodException on
> JDK11.
> As suggested, commons-configuration needs the explicit cast to call
> ByteBuffer.flip(). The release option during the build (
> https://openjdk.org/jeps/247) may help to resolve this issue, if this
> option is not enabled.
>
> 2023년 6월 30일 (금) 오전 7:08, Tres Finocchiaro <tr...@gmail.com>님이
> 작성:
>
>> Personally, I use an explicit cast, which works on both JDK8 and JDK11:
>>
>>
>> https://github.com/qzind/tray/commit/263d7982b7f8d5967385d8c87dcf4cf49ef78540
>>
>

Re: [configurations] 2.9.0 throws NoSuchMethodException on JDK 1.8

Posted by Mingwan Kim <to...@gmail.com>.
I just checked that the example does not throw NoSuchMethodException on
JDK11.
As suggested, commons-configuration needs the explicit cast to call
ByteBuffer.flip(). The release option during the build (
https://openjdk.org/jeps/247) may help to resolve this issue, if this
option is not enabled.

2023년 6월 30일 (금) 오전 7:08, Tres Finocchiaro <tr...@gmail.com>님이
작성:

> Personally, I use an explicit cast, which works on both JDK8 and JDK11:
>
>
> https://github.com/qzind/tray/commit/263d7982b7f8d5967385d8c87dcf4cf49ef78540
>

Re: [configurations] 2.9.0 throws NoSuchMethodException on JDK 1.8

Posted by Tres Finocchiaro <tr...@gmail.com>.
Personally, I use an explicit cast, which works on both JDK8 and JDK11:

https://github.com/qzind/tray/commit/263d7982b7f8d5967385d8c87dcf4cf49ef78540

Re: [configurations] 2.9.0 throws NoSuchMethodException on JDK 1.8

Posted by Tres Finocchiaro <tr...@gmail.com>.
The buffer flip is a JDK regression. Please see here:

https://stackoverflow.com/a/61267496/3196753


On Thu, Jun 29, 2023 at 12:13 PM Gary Gregory <ga...@gmail.com>
wrote:

> Hello,
>
> Commons Configuration is tested with Java 8, 11 and 17:
>
> https://github.com/apache/commons-configuration/blob/master/.github/workflows/maven.yml
>
> What happens when you run on Java 11?
>
> This kind of error can happens when you compile a on Java 9 and run on Java
> 8.
>
> Did you recompile Configuration yourself or are you using it as a Maveb
> dependency?
>
> Gary
>
>
>
> On Thu, Jun 29, 2023, 11:39 Mingwan Kim <to...@gmail.com> wrote:
>
> > Hello,
> >
> > A breaking API change in JDK 9 causes NoSuchMethodException when
> > commons-configurations 2.9.0 runs on JDK 1.8 (check the example
> > https://github.com/tolskais/configurations_1.8).
> > Is commons-configuration2 intended not to support JDK 1.8 or just a bug?
> >
> > Thanks,
> > Mingwan Kim
> >
>

Re: [configurations] 2.9.0 throws NoSuchMethodException on JDK 1.8

Posted by Gary Gregory <ga...@gmail.com>.
Hello,

Commons Configuration is tested with Java 8, 11 and 17:
https://github.com/apache/commons-configuration/blob/master/.github/workflows/maven.yml

What happens when you run on Java 11?

This kind of error can happens when you compile a on Java 9 and run on Java
8.

Did you recompile Configuration yourself or are you using it as a Maveb
dependency?

Gary



On Thu, Jun 29, 2023, 11:39 Mingwan Kim <to...@gmail.com> wrote:

> Hello,
>
> A breaking API change in JDK 9 causes NoSuchMethodException when
> commons-configurations 2.9.0 runs on JDK 1.8 (check the example
> https://github.com/tolskais/configurations_1.8).
> Is commons-configuration2 intended not to support JDK 1.8 or just a bug?
>
> Thanks,
> Mingwan Kim
>