Sparkflows Installer [macOS] Fix: DMG Installer fails with "UnsupportedClassVersionError" (Homebrew Java 17)

The Problem: While trying to install the application via the macOS DMG, the installer failed during the database creation step. A popup error appeared with the following message:

Exception in thread “main” java.lang.UnsupportedClassVersionError: org/h2/Driver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

The Root Cause This is a common quirk with how macOS handles Java installed via Homebrew (brew install openjdk@17).

When you install Java through Homebrew, you usually update your terminal profile (.zshrc or .bash_profile). This tells your terminal where to find Java. However, macOS GUI applications (like DMG installers) do not read your terminal profile. Instead, they ask a system utility (/usr/libexec/java_home) to find Java, and that utility only looks inside one specific folder: /Library/Java/JavaVirtualMachines/.

Because Homebrew doesn’t automatically put Java in that specific Library folder, the DMG installer couldn’t find Java 17. It fell back to an older version of Java (Java 8) installed on my system, which then crashed when trying to run the newer H2 database driver (which requires Java 17).

The Solution: To fix this, you just need to create a symbolic link. This creates a shortcut in the system’s Java folder that points to your Homebrew installation, allowing macOS GUI apps to finally “see” Java 17.

Open your terminal and run the command that corresponds to your Mac’s processor:

For Apple Silicon Macs (M1/M2/M3/M4):

Bash

sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk

For Intel-based Macs:

Bash

sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk

Note: You will be prompted to enter your Mac administrator password since this uses sudo.

Next Steps: Once the symlink is created, simply restart the DMG installer. It will now correctly detect Java 17 through the macOS system registry and complete the installation without throwing the UnsupportedClassVersionError.