Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"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. My JDK 8 is installed using brew install adoptopenjdk8.

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

like image 532
neu242 Avatar asked Jan 31 '20 14:01

neu242


People also ask

How do I fix a corrupted Java Runtime?

The issue can be rectified by manually removing the registry entries that don't correspond manually. Incomplete or corrupted Java Installation – Several users have managed to resolve this particular issue by uninstalling Java and then re-installing the JDK.

Why does my Mac say unable to locate a Java Runtime?

The message “Unable to load Java Runtime Environment” means that the Mac computer cannot load JRE, either because it is out of date or (more usually) because it has not yet been downloaded and installed. It can also happen after the computer OS X has been updated, e.g. to 10.14 Mojave from 10.13 Maverick.

Where is my Java Runtime Environment located?

The value CurrentVersion in HKLM\SOFTWARE\JavaSoft\Java Runtime Environment indicates the version, and JavaHome under HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\{version} provides the path.


1 Answers

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!

like image 172
neu242 Avatar answered Sep 20 '22 14:09

neu242