MacOS – How to make Kindle Preview run on El Capitain

kindlemacos

Installed Kindle Previewer v2.94 but it doesn't open, just crashes without even an error message.

tried to solve using this blog's instructions

but it didn't worked out.

Best Answer

I found this works (from Apple's Java support note )

1) Download and install X11 https://xquartz.macosforge.org/trac

2) Download and install Java for OSX https://support.apple.com/kb/DL1572?locale=en_US

3) finder>applications>(right click) kindle previewer.app>show package contents>contents>macos> (Right click) Launcher>open with> other, choose textedit, then enter the following and save

#!/bin/sh

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

dir=`dirname "$0"`
cd "$dir"
classpath=./:./lib/touchLibs/etc/fonts/fonts

for i in `ls ./lib`
do
classpath=$classpath:./lib/$i
done

export DYLD_LIBRARY_PATH=.

# 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 ]
then
# 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}" com.amazon.epub.reader.Main "$1"
exit 1
else
${JAVA_HOME}/bin/java -d32 -XstartOnFirstThread -Dfile.encoding=UTF-8 -cp "${classpath}" com.amazon.epub.reader.Main
exit 1
fi

4) (Right click) KindlePreviewer>open with> other, choose textedit> then enter the following and save

#!/bin/sh

export JAVA_HOME=/usr/libexec/java_home -v 1.6
# start the autoupdate 
java -jar autoupdate.jar

./Launcher $@

dir=`dirname "$0"`
cd "$dir"
classpath=./

for i in `ls ./lib`
do
    classpath=$classpath:./lib/$i
done


# start the autoupdate  
java  -jar autoupdate.jar

./Launcher $@