Contents | Start | End | Previous: KB0266: Why does my embedded font not show in the Jutoh editor? | Next: KB0268: Why does my book cover not appear on my Kindle after sideloading?


KB0267: EpubCheck fails to run

See also:
How can I fix a Java version error when running Epubcheck?
How can I install Java on Mac OS X 10.11 and above?

Java not installed

If clicking Check shows this help topic, Java is probably not installed. You can download the JDK ('Java SE Development Kit') from www.oracle.com/technetwork/java/javase/downloads/ and restart your machine after installation.

Using an external checker

If you don't want to install Java, or it fails to install, you can submit your file to an external Epub validator checking service that runs EpubCheck for you, such as www.ebookit.com/tools/bp/Bo/eBookIt/epub-validator or epubcheck.mebooks.co.nz/.

Using Kindle Previewer's Java

Alternatively, if you have Kindle Previewer installer, you can try using the Java that's installed with that. On Windows, it can be found in a location similar to this:

C:\Users\USERNAME\AppData\Local\Amazon\Kindle Previewer 3\lib\fc\jre\bin\java.exe

You can find the exact location by viewing the shortcut properties for Kindle Previewer (right-click, click Properties).

To use this location, click on Options on the Jutoh toolbar, click on Helpers, and in Epub checker command, use the above path instead of just java.exe.

So the final command might look something like this:

"C:\Users\USERNAME\AppData\Local\Amazon\Kindle Previewer 3\lib\fc\jre\bin\java.exe" -Xss1024k -jar "$APPDIR$\epubcheck-4.0.1\epubcheck.jar"

Replace USERNAME with your own user name as found on your computer. The quotation marks are important.

On Mac, the command might look like:

"/Applications/Kindle Previewer 3.app/Contents/MacOS/lib/fc/jre/bin/java" -Xss1024k -jar "$APPDIR$/epubcheck-4.0.1/epubcheck.jar"

To restore the original command, using something like the following:

java -Xss1024k -jar "$APPDIR$\epubcheck-4.0.1\epubcheck.jar"

Or, leave the field blank, click OK, and restart Jutoh. The default command will be restored.

Fixing the PATH variable

On Windows, if you installed the JDK and restarted Jutoh but EpubCheck is still not working, try identifying the JDK installation path and setting the PATH environment variable in the control panel to e.g.:

c:\Program Files\Java\jdk-14.0.1\bin

Then restart Jutoh.

"File not found" error

If EpubCheck fails with a "File not found" error because of Unicode characters in file paths, the following command line parameters can be used:

java -Xss1024k -Dsun.jnu.encoding=UTF8 -Dfile.encoding=UTF8 -jar "$APPDIR$\epubcheck-4.01.jar

Stack error

If EpubCheck crashes with a StackOverflowError, try adjusting the thread stack size of your Java Virtual Machine if you haven't already (the default Jutoh setup includes the required flag). With most Java distributions, this can be done by using the -Xss option of the java command, like in the following example:

java -Xss1024k -jar "$APPDIR$\epubcheck-4.0.1\epubcheck.jar"


Contents | Start | End | Previous: KB0266: Why does my embedded font not show in the Jutoh editor? | Next: KB0268: Why does my book cover not appear on my Kindle after sideloading?