pdfannotextractor launch script is missing "-jar" flag

Bug #1892600 reported by Andrew Olney
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
texlive-extra (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

pdfannotextractor is a script that is part of the pax package that is part of texlive-latex-extra : https://packages.ubuntu.com/focal/texlive-latex-extra

The default installation throws this error:

$ pdfannotextractor --debug submission.pdf

PDFAnnotExtractor 0.1l, 2012/04/18 - Copyright (c) 2008, 2011, 2012 by Heiko Oberdiek.
* CLASSPATH: []
* is_win: [0]
* Which kpsewhich: [/usr/bin/kpsewhich]
* Backticks: [kpsewhich --progname pdfannotextractor --format texmfscripts pax.jar]
* Exit code: [0/success]
* pax.jar: [/usr/share/texlive/texmf-dist/scripts/pax/pax.jar]
* pdfbox.jar: [/usr/share/java/pdfbox.jar]
* Which java: [/usr/bin/java]
* System: [java /usr/share/texlive/texmf-dist/scripts/pax/pax.jar submission.pdf]
Error: Could not find or load main class .usr.share.texlive.texmf-dist.scripts.pax.pax.jar
Caused by: java.lang.ClassNotFoundException: /usr/share/texlive/texmf-dist/scripts/pax/pax/jar
* Exit code: [1]

The problem is that the classpath is not properly configured to use the jar. Simply adding the "-jar" flag solves the problem:

$ java -jar /usr/share/texlive/texmf-dist/scripts/pax/pax.jar submission.pdf
* Processing file `submission.pdf' ...

In the code, pdfannotextractor.pl, the change would be located here:

sub launch_pax () {
    check_prg $prg_java, 1;
    my @cmd = ($prg_java);
    push @cmd, $path_jar_pax;
    push @cmd, @ARGV;
    debug 'System', "@cmd";

Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, there are some discussions about that utility on Debian
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670040

Changed in texlive-extra (Ubuntu):
importance: Undecided → Low
Revision history for this message
Andrew Olney (aolney) wrote :

Thanks for the link. Recent problems with pax seem to revolve around pdfbox; however, the current packaging includes pdfbox, possibly to avoid those problems.

Here is a patch that fixes the bug under discussion:

--- pdfannotextractor.pl 2020-08-22 15:40:21.511195000 -0500
+++ pdfannotextractor.pl 2020-08-22 16:19:31.196837000 -0500
@@ -186,6 +186,7 @@
 sub launch_pax () {
     check_prg $prg_java, 1;
     my @cmd = ($prg_java);
+ push @cmd, "-jar";
     push @cmd, $path_jar_pax;
     push @cmd, @ARGV;
     debug 'System', "@cmd";

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in texlive-extra (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.