b936801#diff-c68a17347fa07d05676738879da006c8ce6602ed466304e27f1d5fd6be6f6e6fR64
Prior to 5.0.0 release, the preinst just issued a warning, but did not abort the script.
With the release version however, it does, and leaves the openhab installation on the previous version while happily installing the addons with the new version.
The Java version check should be done during openhab runtime, and not during install time.
When using sdkman for installing Java, sudo java -version and java -version does not necessary see the same version.
See https://community.openhab.org/t/5-0-0-m1-1-openhab-service-not-picking-up-java-21-installed-using-sdkman-but-17-instead/163640/4?u=omr for details, where the Java version in handled be systemd.
I suggest removing the exit 1 from the script, so that install behaviour is similar to the 5.0.0 Mx releases, or do the whole check during openhab runtime startup as not all Java environments are the same.