Adam Bien's Weblog

Sunday Oct 21, 2012

If The Kindle Previewer Won't Start

Kindle Previewer is a Java application, which seems to require JDK 1.6 and does not run on JDK 1.7.

To fix the environment, open /Applications/Kindle Previewer.app/Contents/MacOS/Launcher and add JAVA_HOME pointing to your JDK 1.6 installation right after #!/bin/sh, e.g. export JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"


NEW workshop: Microservices with Java EE 7 and Java 8, January 26th, 2015, Airport Munich

A book about rethinking Java EE Patterns

Comments:

Hi Adam,

if one has not yet updated to Apple Java Update 1.6.0_37 you can set the JDK that will be used with Java Preferences.app by reordering the installed JDKs.

Since the last Apple-Update, Java Preferences.app is missing. But there's still another elegant way:

/usr/libexec/java_home

This tool prints the Java-Home Location of the preferred JDK to stdout. So one can use it in scripts by executing:

export JAVA_HOME=`/usr/libexec/java_home`

There are some command line options with java_home, e.g.:

/usr/libexec/java_home -v1.6 -d32 -ai386

will print the JDK location that best fits the desired version = 1.6 with i386 architecture and 32bit.

So /usr/libexec/java_home is perfect for doing this job.

As with Java Apps packaged with Apple Java Packager Tool, a info.plist is created inside the .app directory. There you could also set the desired JDK version - Just set <key>JVMVersion</key> to 1.6 (NOT 1.6+)...

H.t.h.
Robert

Posted by Robert on October 25, 2012 at 10:50 PM CEST #

Brilliant!
I've just set up a new Mac and as such installed by default JDK 1.7 -- using the above I've managed to get my Kindle Previewer running right away.
Thanks so much!

Liv

Posted by Liviu Tudor on January 31, 2014 at 07:10 PM CET #

Thanks so much for this Adam. Just downloaded and ran the Kindle Previewer on my mac and began to get confused and irritated when it failed to launch. Luckily your solution worked for me. Cheers

Posted by Eric on February 21, 2014 at 05:19 PM CET #

Thanks!!

Posted by Migs on March 27, 2014 at 04:12 AM CET #

Thanks so much for this information! I use Kindle Previewer to convert epub to mobi and never would have put together that it was a Java issue.

Posted by Dominic on July 12, 2014 at 03:40 PM CEST #

This solution worked beautifully! Thanks heaps!

Posted by Anthony Hortin on September 16, 2014 at 05:41 PM CEST #

I think I followed all of the instructions here correctly but unclear whether I've done it right.

Kindle Previewer still crashes every time I launch. I've never gotten anything to open...I used the command line you suggest above --here's a question that likely shows my ignorance...for "usr" in the command line was I supposed to substitute my user name on my Mac?

I'm running the latest Yosemite (which I updated to partly based on someone's comment that it solved their KP problem to do this)

Not sure what to do next...

Posted by Liza on November 06, 2014 at 10:09 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
realworldpatterns.com
...the last 150 posts
...the last 10 comments
License