Visitar URL original
Unsupported class file major version 69 · Issue #2206 · bcgit/bc-java · GitHub
Skip to content

Unsupported class file major version 69 #2206

Closed

Description

@tcurdt

I seems like the latest release

update dependency org.bouncycastle:bcpg-jdk18on to v1.83

was built for an unexpected high class format:

major version 69 = java 25

What happened there?

Activity

  1. dghgit commented on Nov 30, 2025

    @dghgit
    Contributor

    No. Something else is going, the bcpg jar on Maven Central is compiled mostly for Java 8, the module-info.class file is for Java 9.

  2. tcurdt commented on Nov 30, 2025

    @tcurdt
    Author

    There clearly is a bigger difference in 1.82 and 1.83.

    1.82:
    [INFO] Minimizing jar org.vafer:jdeb:maven-plugin:1.15
    [WARNING] Removing module-info from jdeb-1.15.jar
    [INFO] Dependency-reduced POM written at: /Users/tcurdt/Projects/jdeb/dependency-reduced-pom.xml
    [WARNING] bcpg-jdk18on-1.82.jar, bcprov-jdk18on-1.82.jar, bcutil-jdk18on-1.83.jar define 1 overlapping resource:
    [WARNING]   - META-INF/versions/9/OSGI-INF/MANIFEST.MF
    [WARNING] maven-shade-plugin has detected that some files are
    [WARNING] present in two or more JARs. When this happens, only one
    [WARNING] single version of the file is copied to the uber jar.
    [WARNING] Usually this is not harmful and you can skip these warnings,
    [WARNING] otherwise try to manually exclude artifacts based on
    [WARNING] mvn dependency:tree -Ddetail=true and the above output.
    [WARNING] See https://maven.apache.org/plugins/maven-shade-plugin/
    [INFO] Minimized 8880 -> 3810 (42%)
    
    1.83:
    [INFO] Minimizing jar org.vafer:jdeb:maven-plugin:1.15
    [WARNING] org.bouncycastle:bcprov-jdk18on:jar:1.83:compile could not be analyzed for minimization; dependency is probably malformed.
    [WARNING] Removing module-info from jdeb-1.15.jar
    [WARNING] org.bouncycastle:bcprov-jdk18on:jar:1.83:compile could not be analyzed for minimization; dependency is probably malformed.
    

    I checked all class files with javap and most report 52 (java 8), not all are.
    I found classes in the following formats:

      Version 1.82:
      - 4,577 classes: Java 8 (major version 52)
      - 1,134 classes: Java 9 (major version 53)
      - 34 classes: Java 11 (major version 55)
      - 20 classes: Java 15 (major version 59)
      - 20 classes: Java 21 (major version 65)
    
      Version 1.83:
      - 4,584 classes: Java 8 (major version 52) - 7 more than 1.82
      - 1,137 classes: Java 9 (major version 53) - 3 more than 1.82
      - 34 classes: Java 11 (major version 55) - same
      - 29 classes: Java 25 (major version 69) - new
      - 20 classes: Java 15 (major version 59) - same
      - 20 classes: Java 21 (major version 65) - same
    

    which explain the error I am seeing.

    They are in the META-INF/versions/25/ directory though (which is a multi-release JAR feature).
    So my guess is that maven shade plugin has a problem with multi-releases.

  3. dghgit commented on Nov 30, 2025

    @dghgit
    Contributor

    It's probably not the multi-release in itself - that was in 1.82. It'll be Java 25, it's only been official since October, the tool might still be catching up. If the shade plugin isn't verifying the jars, you could remove the signatures and remove what's under versions/25 for now. I'd guess they'd update it fairly soon though - Java 25 adds some significant "new stuff" at least from a cryptography perspective.

  4. winfriedgerlach commented on Dec 2, 2025

    @winfriedgerlach
    Collaborator

    Yes, maven-shade-plugin does not yet feature Java 24/25 support, it is scheduled for the upcoming 3.6.2 release. See

  5. tcurdt commented on Mar 5, 2026

    @tcurdt
    Author

    the new shade plugin was the key to fixing this. sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    support requestCommunity assistance requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions