How can I get java64 bit on pi 4?

322    Asked by KrishnaDwivedi in Java , Asked on Oct 10, 2022

 I switch the Kernel of my Raspi 4 to 64 Bit by changing the /boot/config.txt adding arm_64bit=1.

After a reboot uname -a shows Linux raspberrypi 5.4.72-v8+ #1358 SMP PREEMPT Mon Oct 26 17:29:14 GMT 2020 aarch64 GNU/Linux

So it looks like the 64 Bit kernel is running.

When installing JRE 11 by sudo apt install default-jre it looks like it still uses the 32 Bit version.

So is the PI really running in 64 Bit now?

How can I install a 64 Bit JRE 11?

Answered by Krithika Bhatt

In Debian and derivatives, the default system architecture is not defined by the kernel, but by the architecture of your dpkg package:


pi@raspberrypi:~ $ dpkg -l | grep dpkg

ii dpkg 1.19.7

armhf Debian package management system

Unless you switch dpkg to arm64, any package installation command where the architecture is not specified will assume armhf.

You could try to install arm64 version of Java with

dpkg --add-architecture arm64

apt update

apt install default-jre:arm64

Update: it seems that the actual (at the time of this edit) version of java64 bit Pi OS is getting packages from http://deb.debian.org/debian. Beware that on a 32-bit Pi OS, adding Debian repo as a source and doing an upgrade is known to ruin the system (at least it was the case last time I tried).



Your Answer

Interviews

Parent Categories