“Unable to load Java Runtime Environment” when starting SQLWorkbench/J

I get Unable to load Java Runtime Environment when starting SQLWorkbenchJ.app.

I’m on macOS Catalina 10.15.2, and I installed the app with brew cask install sqlworkbenchj. I have JDK 8 from adoptopenjdk installed.

How do I solve this problem? SQLWorkbench/J does not provide any other helpful messages, even when when I start it with open -a on the command line.

I use JDK 8 installed using brew install adoptopenjdk8

Answer

Luckily I found a hint on SQLWorkbench/J’s forum

The fix was to add …

<key>JVMRuntime</key>
<string>adoptopenjdk-8.jdk</string>

… to /Applications/SQLWorkbenchJ.app/Contents/Info.plist, and create a symlink to JDK8:

ln -s /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk /Applications/SQLWorkbenchJ.app/Contents/PlugIns/

Voila!

Leave a Reply

Your email address will not be published. Required fields are marked *