Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Zulu JDK 21 installation on 64bit #1861

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

holgerfriedrich
Copy link
Member

Requires a native 64 bit image, running a 64 bit kernel with 32-bit OS is not sufficient.

I have been working to make OH compile an run with Java21 openhab/openhab-distro#1590. Not all of the required PRs have been merged, so we are not yet there.
This PR allows to install Java21 on x64/aarch64 systems.

Running the snapshot distro without modification is not yet possible, still waiting for the PR openhab/openhab-distro#1640
to be merged.

Requires a native 64 bit image, running a 64 bit kernel with
32-bit OS is not sufficient.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Copy link
Contributor

@mstormi mstormi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires a native 64 bit image, running a 64 bit kernel with 32-bit OS is not sufficient.

Please add proper checks for this in the install routine to ensure it only installs when the prerequisites are met

@holgerfriedrich
Copy link
Member Author

Hi @mstormi,
I think the checks are already there, shared by the Zulu11-64 and Zulu 21-64 targets.
if is_aarch64 || is_x86_64 && [[ $(getconf LONG_BIT) == 64 ]]; then
The check with getconf is really necessary - I had my RPI image that showed aarch64 but LONG_BIT 32 with a 32 bit userland.

If the prerequisites are not met, the common error reaction is to show a message in interactive setup (good) or to install Zulu-32 in the interactive case (maybe not so well suited).
As the code for the fallback is shared and there is no Java 21 32bit available anyway, this might be ok.

WDYT?

Btw: anything wrong with my change which causes the bats test to fail, or are the tests affected by something else?

Copy link
Contributor

@mstormi mstormi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine then
no BATS test failing is unrelated

@mstormi mstormi merged commit b6a3217 into openhab:main Apr 5, 2024
9 of 11 checks passed
@holgerfriedrich holgerfriedrich deleted the pr-java21 branch April 5, 2024 20:17
@holgerfriedrich
Copy link
Member Author

Thanks, Markus

@mstormi
Copy link
Contributor

mstormi commented Apr 17, 2024

Hi Holger,

would you consider adding openjdk21 as PR, too ? In short

echo "deb http://ftp.de.debian.org/debian/ testing main" >> /etc/apt/sources.list.d/raspi.list
apt-get install  openjdk-21-jre-headless
[16:06:02] root@openhabian:/etc/apt/sources.list.d# java -version
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment (build 21.0.2+13-Debian-2)
OpenJDK 64-Bit Server VM (build 21.0.2+13-Debian-2, mixed mode, sharing)
[16:06:13] root@openhabian:/etc/apt/sources.list.d# getconf LONG_BIT
64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants