Created
January 13, 2015 12:51
-
-
Save amusarra/e7b957b9e2a23e05d0d5 to your computer and use it in GitHub Desktop.
Add JAVA_HOME on Launcher of Kindle Previewer OS X Yosemite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dir=`dirname "$0"` | |
cd "$dir" | |
classpath=./:./lib/touchLibs/etc/fonts/fonts | |
for i in `ls ./lib` | |
do | |
classpath=$classpath:./lib/$i | |
done | |
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home | |
# 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 -d32 -XstartOnFirstThread -Dfile.encoding=UTF-8 -cp "${classpath}" com.amazon.epub.reader.Main "$1" | |
exit 1 | |
else | |
java -d32 -XstartOnFirstThread -Dfile.encoding=UTF-8 -cp "${classpath}" com.amazon.epub.reader.Main | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment