I am trying to install java 12 on my pi. I can only use the terminal. Any Ideas what I have to do? it seems that java 12 isnt in the Repositorys.

Thank you in advance


2 Answers 2


If you are using Ubuntu try this:

sudo apt install openjdk-12-jdk

Use the following command to verify the installed version of Java on your system.

java -version

If you are using Debian try this:

Create a new Apt configuration file /etc/apt/sources.list.d/java-13-debian.list, and edit in text editor.

sudo vim /etc/apt/sources.list.d/java-13-debian.list

and add following content in it.

deb http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main
deb-src http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main

Now import GPG key on your system for validating packages before installing them.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EA8CACC073C3DB2A

Run the following commands to update apt-cache and then install Java 13 on the Debian system using the apt-get package manager.

sudo apt-get update
sudo apt-get install oracle-java13-installer

Use the following command to verify the installed version of Java on your system.

java -version
java version "13" 2019-09-17
Java(TM) SE Runtime Environment (build 13+33)
Java HotSpot(TM) 64-Bit Server VM (build 13+33, mixed mode, sharing)
  • But on Debian/Raspbian (that's what the OP use) it will install version 13 and not version 12 as asked.
    – Ingo
    Nov 19, 2019 at 18:51

I'm using the BellSoft Liberica JDK's on Raspbian.

If you start from a fresh Raspbian you will have version 11

$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-post-Raspbian-5)
OpenJDK Server VM (build 11.0.3+7-post-Raspbian-5, mixed mode)

Easiest way to install:

  • Visit https://bell-sw.com/
  • Look for the version you want to use for "Linux ARM v7 & v8 32 bit HardFloat"
  • Copy the link location to the deb-file
  • Run the following script (is for the version 12.0.2 you are looking for)
  • Check if the version installed correctly by running "java -version" again

$ cd /home/pi

$ wget https://download.bell-sw.com/java/12.0.2/bellsoft-jdk12.0.2-linux-arm32-vfp-hflt.deb

$ sudo apt-get install ./bellsoft-jdk12.0.2-linux-arm32-vfp-hflt.deb

$ sudo update-alternatives --config javac

$ sudo update-alternatives --config java

  • 1
    You downloaded bellsoft-jdk12.0.2-linux-arm32-vfp-hflt.deb (jdk12) and installed bellsoft-jdk13-linux-arm32-vfp-hflt.deb (jdk13)? Really?
    – Ingo
    Nov 21, 2019 at 10:49
  • Sorry @Ingo my mistake, copy/paste and only half adapted ;-) Fixed now!
    – Frank
    Nov 21, 2019 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.