|

Running epubcheck on your computer

epubcheck is a valuable tool for anyone working with EPUB documents. Many beginners choose to start using it via the online validator at http://threepress.org/document/epub-validate, but it’s a mistake to use that too often. More explicitly:

If you’re making more than 3 EPUBs this year, you must setup epubcheck on your computer

Why setup epubcheck locally? If you have a local copy, you can:

Warning

This is a brief description of how you might be able to run epubcheck locally. This isn’t a tech support site, so please don’t post system questions in the comments.

Setup for both platforms

  1. Ensure java is installed and in your PATH (Google is your friend if not)
  2. Download the “binary” release you’d like to use (probably the featured one) from the epubcheck downloads page
  3. Unzip the downloaded .zip file to somewhere on your computer
  4. Find the file epubcheck-[something].jar in the newly unzipped folder (and keep this window open)
  5. Find the EPUB file you’d like to validate (and keep this window open)

Each time you’d like to run epubcheck, you’ll need to ask the java command to run the epubcheck program (packaged as a .jar file) against your EPUB file. Happily, you can get drag and drop to help you with most of the filenames.

Windows

  1. Open the “Run…” menu using [Windows-key]+r, Start Menu->Run…, or turning it on for Vista.
  2. In the “Run…” menu, type cmd.exe.
  3. In the new Command Prompt window (the “prompt”), type java -jar (note trailing space after “-jar”).
  4. Drag the epubcheck .jar file from the unzipped folder into the Command Prompt window (the location of the file ["path"] should be copied).
  5. Type another space in the terminal window after the .jar filename.
  6. Similarly, drag the EPUB file from wherever into the Command Prompt window (it’s path should also be copied).
  7. Press Enter.
  8. Note the results in the Command Prompt window (No errors or warnings detected means it passed).

Mac

  1. In the Finder, to Go->Utilities, then find the Terminal application (or do a Spotlight search for “Terminal”) and start it.
  2. In the new Terminal window (the “prompt”), type java -jar (note trailing space after “-jar”).
  3. Drag the epubcheck .jar file from the unzipped folder in the Finder into the Terminal window (the location of the file ["path"] should be copied).
  4. Type another space in the terminal window after the .jar filename.
  5. Similarly, drag the EPUB file from wherever in the Finder into the Terminal window (it’s path should also be copied).
  6. Press Return.
  7. Note the results in the Terminal window (No errors or warnings detected means it passed).

Linux

Ha, you’re on your own! (But do see the good comment from Toby Stevenson, below.)

Other tools

Now that you’ve mastered the above, you can try to run the epubpreflight checking tool in the same manner. It helps check if files are too big for the older Sony Reader devices, for example.

About Keith Fahlgren

Keith Fahlgren is the Director of Engineering at Safari Books Online. He works on tools that help readers learn and build skills with digital content. He has been involved in a range of projects in the digital publishing ecosystem, including EPUB 3, OPDS, DocBook, and Ibis Reader.
|

5 Responses to Running epubcheck on your computer

  1. Instructions for Ubuntu/Debian:

    1. Open Terminal.
    2. Check if you have java already by typing java -ver at the prompt. If you do skip to step 4
    3. To install java in the terminal it is best to make sure your system is up to date first. We can update our package list, upgrade our system and install java all on one line. Type into the terminal sudo apt-get update;sudo apt-get upgrade;sudo apt-get install sun-java6-jre
    4. Grab the latest epubcheck by typing wget http://epubcheck.googlecode.com/files/epubcheck-1.1.zip
    5. Unzip it with unzip epubcheck-1.1.zip
    6. Lastly run epubcheck on your book file. I’m assuming you know where this file is to provide the full path. The basic psuedo command is as follows:
      java -jar epubcheck.jar "/path/to/book.epub"
  2. Toby says:

    If you’re not so familiar with handling command line tools and if you are working on Windows, I might suggest our free “EPUB-Checker”, which capsules the epubcheck-tool in a comfortable GUI.
    And if you are able to speak German or if you’re a native german speaker our “EPUB-Checker” also provides german translations for almost every epubcheck warning or error…

    Try the free download!
    http://www.pagina-online.de/software/epub-checker/

  3. Brice says:

    Or you may download this app too (EPUB check + preflight) for Mac, Linux or PC.

  4. How come preflight isn’t included in epubcheck? That would be so very, very handy. I run the epubcheck locally on my computer. We distribute epub-files to all kinds of ereaders and need to check for content files larger than 300KB.
    I saw there is an app to download above, but I would prefer if the “original epubcheck” included this. Would be so nice…