Skip to content

Remove java cross-comp options, include debuginfo#144

Merged
Mytherin merged 1 commit intoduckdb:mainfrom
staticlibs:jdk8_and_debug_flags
Mar 17, 2025
Merged

Remove java cross-comp options, include debuginfo#144
Mytherin merged 1 commit intoduckdb:mainfrom
staticlibs:jdk8_and_debug_flags

Conversation

@staticlibs
Copy link
Collaborator

When compiling Java part with JDK 11 (or later), the current javac options -source 1.8 and -tatget 1.8 are ineffective. Resulting bytecode format is compatible with JDK 8, but cannot be run on JDK 8 because it is compiled against the bootstrap classpath of JDK 11 and depends on methods not available in JDK 8.

This change removes these cross-compilation flags. It is assumed, that official release binaries are always built with JDK 8. For users/packagers, who is going to build the driver from source, a CMake configure-time warning about JDK 8 compatibility is added.

Additionally Java debuginfo is added to the JAR (-g flag). It does not affect the performance and the JAR size increase is minor (less than 10KB).

Fixes: #143

@staticlibs staticlibs force-pushed the jdk8_and_debug_flags branch from 91879ca to c9895b0 Compare March 15, 2025 09:51
When compiling Java part with JDK 11 (or later), the current javac
options `-source 1.8` and `-tatget 1.8` are ineffective. Resulting
bytecode format is compatible with JDK 8, but cannot be run on JDk 8
because it is compiled against the bootstrap classpath of JDK 11 and
depends on methods not available in JDK 8.

This change removes these cross-compilation flags. It is assumed, that
official release binaries are always built with JDK 8. For
users/packagers, who is going to build the driver from source, a
CMake configure-time warning about JDK 8 compatibility is added.

Additionally Java debuginfo is added to the JAR (`-g` flag). It does
not affect the performance and the JAR size increase is minor (less
than 10KB).

Fixes: duckdb#143
@staticlibs staticlibs force-pushed the jdk8_and_debug_flags branch from c9895b0 to 648be7f Compare March 17, 2025 11:53
Copy link
Member

@hannes hannes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great solution, did not know this was an issue

@staticlibs
Copy link
Collaborator Author

Thanks for the review! @Mytherin mentioned that he can merge this PR (and #164 along with it) after they have completed the CI runs after the rebase.

@Mytherin Mytherin merged commit e9b93b2 into duckdb:main Mar 17, 2025
7 checks passed
@Mytherin
Copy link
Contributor

Thanks!

@staticlibs staticlibs deleted the jdk8_and_debug_flags branch March 17, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JDBC driver built with JDK 11 cannot be used with JDK 8

3 participants