简体   繁体   中英

RaspberryPi 4 with Java 13.0.1

Does anybody know how I can install Java 13.0.1 on a RaspberryPi 4?

Because I use [Java 13.0.1] 1 on my WindowsEngine and so I wrote and exported my JavaApplication with Java 13.0.1 but the RaspberryPi only supports a licensed Version of Java 11.0.5 which is not available for free.

偏

Surprised nobody has posted about this yet; you can totally install recent versions of Java on Raspbian.

In this example, I'll be using an AdoptOpenJDK OpenJDK build to install Java 14 on Raspbian Stretch.

# 1) Download the armhf jdk14 binary
wget 'https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/pool/main/a/adoptopenjdk-14-hotspot/adoptopenjdk-14-hotspot_14.0.0+36-2_armhf.deb'

# 2) now install it, and don't worry if it spits out a ton of errors, this is normal
sudo dpkg -i 'adoptopenjdk-14-hotspot_14.0.0+36-2_armhf.deb'

# 3) install missing dependencies
sudo apt-get install -f

And that's it! Running java -version now yields:

$ java -version
openjdk version "14" 2020-03-17
OpenJDK Runtime Environment AdoptOpenJDK (build 14+36)
OpenJDK Server VM AdoptOpenJDK (build 14+36, mixed mode, sharing)

Ok, I decided to download Java 11.0.5 to my windows engine and build the JavaProjects as a Java 11.0.5 Application.

Paying for any version of Java is getting ripped off: don't do it ever, unless you need to comply with licensing for a professional project (or something).

There isn't currently something you can install from apt-get , but Bell-SW has Java 13 packages for ARMv7 (you just have to scroll down) and they have instructions for how to install.

https://bell-sw.com/pages/java-13.0.2/

For free.

or just use the AdoptOpenJDK repos:

echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb buster main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo apt-get update
apt-cache search adoptopenjdk
sudo apt-get install adoptopenjdk-15-hotspot

Those are the condensed instructions for Linux RPM and DEB installer packages

apt-cache search adoptopenjdk - shows a list of packages (versions) available (incl. v8 & v11)

If you want/need to build JDK, you can start with this gist .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM