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

Enforce -release 8 base compilation target #2250

Merged
merged 2 commits into from
Dec 17, 2024
Merged

Enforce -release 8 base compilation target #2250

merged 2 commits into from
Dec 17, 2024

Conversation

jhy
Copy link
Owner

@jhy jhy commented Dec 17, 2024

Restructured the compile phases in the POM so that when executing on Java 9+, the base classes are compiled with -release 8. This ensures that the bootstrap class path uses the Java 8 API, and so the produced jar is binary compat with Java 8.

(Whilst that option had been previously set, it was ignored as Maven's default compile stage was executed prior; this change disables the default compilations so that the platform specific activations are activated.)

When built on Java 8, the original source and target (vs release) are used.

Fixes an issue where when running on Java 8 (but built on Java9+), java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; would be thrown in ControllableInputStream buffering up, because the return expected Buffer, not the binary incompatible ByteBuffer.

jhy added 2 commits December 17, 2024 12:49
Restructured the compile phases in the POM so that when executing on Java 9+, the base classes are compiled with -release 8. This ensures that the bootstrap class path uses the Java 8 API, and so the produced jar is binary compat with Java 8.

When built on Java 8, the original source and target (vs release) are used.

Fixes an issue where when running on Java 8 (but built on Java9+),  `java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;` would be thrown in ControllableInputStream buffering up, because the return expected `Buffer`, not the binary incompatible `ByteBuffer`.
@jhy jhy added the fixed label Dec 17, 2024
@jhy jhy added this to the 1.19.1 milestone Dec 17, 2024
@jhy jhy merged commit 2b526b3 into master Dec 17, 2024
21 checks passed
@jhy jhy deleted the jdk8-release branch December 17, 2024 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant