Problems with EpubCheck

Hello Everyone,

So I had Pressbooks installed and running for over a year with no problems. I decided to update it to the latest version and all hell broke loose.

I have been able to fix all the problems except that I can’t export my books. I get an error saying that I am missing dependencies. I went ahead and updated all my dependencies (Kindle and epub) but I am still getting the same error.

Here is the line of code in WP-Config file for the epub installation:

define( ‘PB_EPUBCHECK_COMMAND’, ‘/usr/bin/java -jar /home4/jdrodri/usr/bin/epubcheck/epubcheck-4.0.jar’ );

Can someone please tell me what I am doing wrong?



Hi @josuerodriguez, what is the result when you run this on your server?

/usr/bin/java -jar /home4/jdrodri/usr/bin/epubcheck/epubcheck-4.0.jar -h

Hello. I see that ned is aiming to help with your dilemma. I was merely jumping in to ask if, by chance, you documented all the fixes you did to get new Pressbooks version to work, @josuerodriguez? I am in the same boat you were in, meaning persisting with older version of Pressbooks and considering upgrade to current version in March or April. Welcome your thoughts.

Hi @mark.stiffler, I provided some comprehensive steps to seeing if your dependencies are available to Pressbooks on @josuerodriguez’s GitHub issue earlier:

1 Like

One note is that EpubCheck is not a strict requirement. It validates your EPUB’s conformance to the EPUB specifications, and if your EPUB isn’t compliant then your MOBI files will likely be rejected by Amazon (MOBI is created by transforming an EPUB 2.0 export). If you don’t care about this, you can disable the check for EpubCheck by adding the following to a file (say, override-dependency-checks.php) in /wp-content/mu-plugins/:


// Ignore missing EpubCheck
add_filter( 'pb_epub_has_dependencies', '__return_true' );

I don’t have that file in that folder.

ok… I am trying to do so now. Having a bit of issue accessing my server via SSH

I got your point. Sorry flew over my head. I did that, but the problem persists.

What was the output from running the command on your server?

no such file or directory… funny that is the actual location of the file

here is the actual error:

/usr/bin/java: No such file or directory

Then your server either doesn’t have Java on it, or java is somewhere else, which is required to run the JAR file.

What kind of server is it? On Ubuntu, epubcheck can simply be installed by doing sudo apt install epubcheck Then you do

which epubcheck

And use that as the path.

For me its: define( 'PB_EPUBCHECK_COMMAND', '/usr/bin/epubcheck' );

IMHO your old version or Pressbooks simply never had this working? Newer versions requires it unless you skip using:

// Ignore missing EpubCheck
add_filter( 'pb_epub_has_dependencies', '__return_true' );

That was the issue… It worked with this command: define( ‘PB_EPUBCHECK_COMMAND’, ‘/home4/jdrodri/usr/bin/epubcheck/epubcheck.jar’ );

I’d be surprised if you can run jar file without Java?

If it’s working that’s great but I think “path to file” and “running epubcheck” might be two separate problems here. You will need to fix both.

What is the output of which java?