Skip to content

1.3.21 (on Maven Central) is broken on Java 8 #411

Closed
@lapo-luchini

Description

@lapo-luchini

I guess 1.3.21 on Maven Central was compiled using Java 9+, as I get this error (doesn't happen with 1.3.20):

java.lang.NoSuchMethodError: java.nio.MappedByteBuffer.position(I)Ljava/nio/MappedByteBuffer;                                                                                                           
        at com.lowagie.text.pdf.MappedRandomAccessFile.seek(MappedRandomAccessFile.java:167)                                                                                                            
        at com.lowagie.text.pdf.RandomAccessFileOrArray.seek(RandomAccessFileOrArray.java:329)                                                                                                          
        at com.lowagie.text.pdf.PRTokeniser.getStartxref(PRTokeniser.java:221)                                                                                                                          
        at com.lowagie.text.pdf.PdfReader.readXref(PdfReader.java:1369)                                                                                                                                 
        at com.lowagie.text.pdf.PdfReader.readPdf(PdfReader.java:600)

I guess the reason is that targeting the compiler to Java 8 is not enough, as the libraries are different and the method MappedByteBuffer.position(int) is new in Java9.

(I'm opening this as a reminder, but I didn't look into a way to resolve it, yet)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions