Running epubcheck on your computer
by Keith Fahlgren
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:
- run it even if the online validator is down (it was this morning)
- run any version of epubcheck you want (useful when new versions are near release)
- run it more quickly
- run it on a lot of documents quickly (with a little command-line-foo)
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
- Ensure java is installed and in your
PATH(Google is your friend if not) - Download the “binary” release you’d like to use (probably the featured one) from the epubcheck downloads page
- Unzip the downloaded
.zipfile to somewhere on your computer - Find the file
epubcheck-[something].jarin the newly unzipped folder (and keep this window open) - 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
- Open the “Run…” menu using [Windows-key]+r, Start Menu->Run…, or turning it on for Vista.
- In the “Run…” menu, type
cmd.exe. - In the new Command Prompt window (the “prompt”), type
java -jar(note trailing space after “-jar”). - Drag the epubcheck
.jarfile from the unzipped folder into the Command Prompt window (the location of the file ["path"] should be copied). - Type another space in the terminal window after the
.jarfilename. - Similarly, drag the EPUB file from wherever into the Command Prompt window (it’s path should also be copied).
- Press Enter.
- Note the results in the Command Prompt window (
No errors or warnings detectedmeans it passed).
Mac
- In the Finder, to Go->Utilities, then find the Terminal application (or do a Spotlight search for “Terminal”) and start it.
- In the new Terminal window (the “prompt”), type
java -jar(note trailing space after “-jar”). - Drag the epubcheck
.jarfile from the unzipped folder in the Finder into the Terminal window (the location of the file ["path"] should be copied). - Type another space in the terminal window after the
.jarfilename. - Similarly, drag the EPUB file from wherever in the Finder into the Terminal window (it’s path should also be copied).
- Press Return.
- Note the results in the Terminal window (
No errors or warnings detectedmeans 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.
Comments
Instructions for Ubuntu/Debian:
sudo apt-get update;sudo apt-get upgrade;sudo apt-get install sun-java6-jrewget http://epubcheck.googlecode.com/files/epubcheck-1.1.zipunzip epubcheck-1.1.zipIf 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/
Or you may download this app too (EPUB check + preflight) for Mac, Linux or PC.
Oups, here’s the link:
http://www.rainwater-soft.com/epubchecker/
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…