openhab / openhab/openhab-linuxpkg

Too strict Java 21 check during preinst. Will also end up different from addons version, possibly failing fallback.

Open
#237 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
18
Forks
35
PR merge metrics
No merged PRs in 30d

Description

https://github.com/openhab/openhab-linuxpkg/commit/b93680142a2ca10b607e1290c7550420215e89e2#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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Java 21 check in the preinst script at the linked commit and compare it with the 5.0.0 Mx behavior. Review how Java is selected for the openHAB service through systemd, then verify that installation does not abort while the required Java version is handled at runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.