dbeaver-failed-to-create-java-virtual-machine-macos

Attempting to open Dbeaver Community on MacOS (installed via Homebrew) results in the following error: 'Failed to create java virtual machine'.

This seems to be a bug having to do with the java bundle used by DBeaver 1 2

Solved by installing an earlier version of openjdk (version 13, though the DBeaver maintainer recommends version 11 at time of writing, as that is what's bundled with the binary installer).

brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk13

To force DBeaver to use the desired version of java, find the following section in /Applications/DBeaver.app/Contents/Info.pli:

    <key>Eclipse</key>
        <array>
            <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options:
                <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/java</string>
                <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java</string>
            -->
            <string>-keyring</string><string>~/.eclipse_keyring</string>
            <!-- WARNING:
                If you try to add a single VM argument (-vmargs) here,
                *all* vmargs specified in eclipse.ini will be ignored.
                We recommend to add all arguments in eclipse.ini
             -->
        </array>

and add an uncommented line pointed to the preferred version of java (in our case provided by the adoptopenjdk13 package:

            <string>-vm</string><string>/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/bin/java</string>

and DBeaver should begin working once again.

Tags

 DBeaver  MacOS  Java