[ 
https://issues.apache.org/jira/browse/HDDS-11076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Doroszlai updated HDDS-11076:
------------------------------------
    Description: 
Building Ozone with Java 9+ (but with target=8) and running with Java 8 results 
in:

{code}
NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
        at 
org.apache.hadoop.ozone.common.ChunkBufferImplWithByteBuffer.duplicate(ChunkBufferImplWithByteBuffer.java:111)
{code}

Explanation:
https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/

Can be fixed by setting {{--release}} for {{javac}} (only for JDK 9+, since 
it's a new param), via {{maven.compiler.release}}.

When using {{--release}}, access to Sun internal API is not allowed: 
https://bugs.openjdk.org/browse/JDK-8206937  Therefore this fix requires 
HDDS-11078.

  was:
Building Ozone with Java 9+ (but with target=8) and running with Java 8 results 
in:

{code}
NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
        at 
org.apache.hadoop.ozone.common.ChunkBufferImplWithByteBuffer.duplicate(ChunkBufferImplWithByteBuffer.java:111)
{code}

https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/
https://bugs.openjdk.org/browse/JDK-8206937


> NoSuchMethodError: ByteBuffer.position compiling with Java 9+, running with 
> Java 8
> ----------------------------------------------------------------------------------
>
>                 Key: HDDS-11076
>                 URL: https://issues.apache.org/jira/browse/HDDS-11076
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: build
>            Reporter: Attila Doroszlai
>            Assignee: Attila Doroszlai
>            Priority: Major
>
> Building Ozone with Java 9+ (but with target=8) and running with Java 8 
> results in:
> {code}
> NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
>       at 
> org.apache.hadoop.ozone.common.ChunkBufferImplWithByteBuffer.duplicate(ChunkBufferImplWithByteBuffer.java:111)
> {code}
> Explanation:
> https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/
> Can be fixed by setting {{--release}} for {{javac}} (only for JDK 9+, since 
> it's a new param), via {{maven.compiler.release}}.
> When using {{--release}}, access to Sun internal API is not allowed: 
> https://bugs.openjdk.org/browse/JDK-8206937  Therefore this fix requires 
> HDDS-11078.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to