Skip to content

Replace unmaintained lz4-java with Apache Commons Compress LZ4 #2437

@laurentpellegrino

Description

@laurentpellegrino

org.lz4:lz4-java (1.8.0) has been unmaintained for years and triggers JDK 17 + startup warnings:

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by net.jpountz.util.Native in an unnamed module (file:/home/X/.gradle/caches/modules-2/files-2.1/org.lz4/lz4-java/1.8.0/4b986a99445e49ea5fbf5d149c4b63f6ed6c6780/lz4-java-1.8.0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

This native-loading path can also hurt performance.

Proposed fix

  • Drop org.lz4:lz4-java.
  • Add org.apache.commons:commons-compress (current release).
  • Switch to its LZ4 APIs (org.apache.commons.compress.compressors.lz4.*).

Apache Commons Compress is actively maintained and JDK-compatible:
https://commons.apache.org/proper/commons-compress/apidocs/org/apache/commons/compress/compressors/lz4/package-summary.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions