Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Java 16 on Raspberry Pi 4

I have tried multiple releases from here using :

sudo -i 
cd /usr/lib/jvm
wget [release link here]
tar xzf [file name here]
export PATH=$PWD/[dir here]/bin:$PATH
java -version

But after java -version I always get:

/usr/lib/jvm/[dir here]/bin/java: cannot execute binary file: Exec format error

Which means I have chosen the wrong release/architecture. Is there a release that works with Raspberry Pi's or is there another way to install Java 16?

like image 627
resuther Avatar asked Jun 09 '21 06:06

resuther


People also ask

Is Java 16 still supported?

Oracle JDK releases for Java 16 and earlier versions continue to be made available under the Oracle Technology Network License Agreement for Java SE, which is free for Personal, Development and other Users only. For more information on Oracle Java licensing, please see the Oracle Java SE Licensing FAQ.

Does OpenJDK have Java 16?

JDK 16 is the open-source reference implementation of version 16 of the Java SE Platform, as specified by by JSR 390 in the Java Community Process. JDK 16 reached General Availability on 16 March 2021.


Video Answer


1 Answers

Answering my own question.

cd [minecraft directory here]

wget https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk16u-2021-05-08-12-45/OpenJDK16U-jdk_arm_linux_hotspot_2021-05-08-12-45.tar.gz

tar xzf OpenJDK16U-jdk_arm_linux_hotspot_2021-05-08-12-45.tar.gz

export PATH=$PWD/jdk-16.0.1+4/bin:$PATH

java -version

You might have to do export PATH=$PWD/jdk-16.0.1+4/bin:$PATH after a reboot

like image 93
resuther Avatar answered Oct 16 '22 09:10

resuther