Sunday, September 13, 2015

Fixing "you need to install the legacy Java SE 6 runtime." errors

For various reasons I wanted to try out Universal Media Server on my MacBook OS X Yosemite 10.10.5 before I install it for real on my Linux box. However, this was not as easy as I thought it would be, because upon starting the app, an error window appears with the text "you need to install the legacy Java SE 6 runtime."

Yes, doing that would have been the easy fix, but the legacy Java SE 6 runtime is old, with many known security exploits, and  I already have the latest JDK8 installed, why can't I just use that?

This process was not as straightforward as expected, but easy enough, explained at http://stackoverflow.com/a/19594116:
  1. Make sure Java is up to date.
  2. Edit the Info.plist file (I did this via command line):
    • sudo vi /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Info.plist
      •  In the "JVMCapabilities" array, make sure it has the three following entries:
      •                         JNI
                                BundledApp
                                CommandLine
  3. Link a dynamic library:
    • sudo mkdir -p /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bundle/Libraries/
    • sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/server/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bundle/Libraries/libserver.dylib
  4. Reboot.
Once those steps were completed, I was able to run the Universal Media Server app. If only the first step is applied, then the error "LSOpenURLsWithRole() failed with error [XXXXX]" occurs instead.

No comments: