Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binaries are invalid when compiled on Java 11 and run on Java 8 #4202

Closed
lhotari opened this issue Feb 7, 2024 · 3 comments
Closed

Binaries are invalid when compiled on Java 11 and run on Java 8 #4202

lhotari opened this issue Feb 7, 2024 · 3 comments
Labels

Comments

@lhotari
Copy link
Member

lhotari commented Feb 7, 2024

BUG REPORT

Describe the bug

The current Bookkeeper maven build will produce invalid binaries for Java 8 when compiled on Java 11.

Here's an example of the problem:

2024-02-07T15:33:44,901 - ERROR - [BookieJournal-3181:BookieCriticalThread@41] - Uncaught exception in thread BookieJournal-3181 and is exiting!
java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
        at org.apache.bookkeeper.bookie.JournalChannel.writeHeader(JournalChannel.java:255) ~[org.apache.bookkeeper-bookkeeper-server-4.17.0-SNAPSHOT.jar:4.17.0-SNAPSHOT]
        at org.apache.bookkeeper.bookie.JournalChannel.<init>(JournalChannel.java:188) ~[org.apache.bookkeeper-bookkeeper-server-4.17.0-SNAPSHOT.jar:4.17.0-SNAPSHOT]
        at org.apache.bookkeeper.bookie.JournalChannel.<init>(JournalChannel.java:124) ~[org.apache.bookkeeper-bookkeeper-server-4.17.0-SNAPSHOT.jar:4.17.0-SNAPSHOT]
        at org.apache.bookkeeper.bookie.Journal.run(Journal.java:996) ~[org.apache.bookkeeper-bookkeeper-server-4.17.0-SNAPSHOT.jar:4.17.0-SNAPSHOT]

To Reproduce

  1. Compile binaries on Java 11.
  2. Run bookkeeper on Java 8.

Expected behavior

The binaries should be Java 8 compatible as long as we provide the support.

Additional context

Similar problem was solved in Pulsar by properly using maven.compiler.release setting.

@lhotari
Copy link
Member Author

lhotari commented Feb 7, 2024

I'm handling this in #4197 since this is required for fixing CI.

@lhotari
Copy link
Member Author

lhotari commented Feb 7, 2024

similar as apache/pulsar#8445

@lhotari
Copy link
Member Author

lhotari commented Feb 8, 2024

This is fixed in #4197 since it was needed to get CI passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant