How to install Java on Arch Linux

Jeroen Kransen picture Jeroen Kransen · Nov 18, 2012 · Viewed 78.8k times · Source

According to https://wiki.archlinux.org/index.php/Java I can install Open JDK 7 on a clean Arch Linux installation by invoking the command

pacman -S jdk7-openjdk

But when doing so, I get an error saying

error: target not found: jdk7-openjdk

I already commented out my nearest Pacman repository in /etc/pacman.d/mirrorlist and ran a first update by invoking pacman -Syu hoping that this would cause the package above to be discovered.

How can I install Open JDK 7 on Arch Linux using pacman?

Edit: I'm running a Raspberry Pi with an ARM processor and I'm hoping to get a Java build that is tailored for its hardware and uses the OS hardware floating point support.

Answer

Andrea Scarpino picture Andrea Scarpino · Jan 7, 2013

Get the best mirror near you (check this list); you can even generate a new mirror list on the archlinux website. Then run # pacman -Syy; # pacman -Su; # pacman -S jdk8-openjdk (or jre8-openjdk if you only need the JRE)