Fixing Amazon’s Kindle Previewer in El Capitan

For some reason getting Amazon’s Kindle Previewer to work on El Capitan is not an easy task. There are a few resources online that pointed in the right direction but didn’t fully solve the problem for me. Here is what worked for me, extracted from the Amazon forums‎.

Amazon Kindle Previewer

1. Install X11 and Java for OSX


2. Open the Launcher shell script with a text editor

The Launcher file is located in /Applications/Kindle

Go to Finder → Applications → Kindle, right click the file, Show package contents → Contents → MacOS → Launcher, right click the file, Open with → other, choose TextEdit or your favorite text editor.

3. Edit the Launcher file

First add the following line below #!/bin/sh:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"

Then replace the two occurrences of java -d32 with ${JAVA_HOME}/bin/java -d32.

The new file should look like this:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"

dir=`dirname "$0"`
cd "$dir"

for i in `ls ./lib`


# start the previewer
fileExtT=`echo $1 | awk -F. '{print $NF}'`
fileExt=`echo $fileExtT | tr '[:upper:]' '[:lower:]'`

if [ "$fileExt" == mobi -o "$fileExt" == azw3 -o "$fileExt" == epub -o "$fileExt" == opf -o  "$fileExt" == html -o  "$fileExt" == zip ]
    # opens only the first book in command line.  TODO: handle multiple books in command line
    ${JAVA_HOME}/bin/java -d32 -XstartOnFirstThread -Dfile.encoding=UTF-8 -cp "${classpath}" "$1"
    exit 1
    ${JAVA_HOME}/bin/java -d32 -XstartOnFirstThread -Dfile.encoding=UTF-8 -cp "${classpath}"
    exit 1

4. Save the changes

You are done.

If you still run into issues it could be that a java process or a previous Kindle Previewer process is still running in the background and preventing the changes from taking effect. Kill the zombie processes (in the terminal or restarting your computer), and things should work now.

Good luck!

December 27, 2015 ☼ code