How to install Java on Arch Linux

Just a quick observation:

When you change your repository it is a good idea to update using pacman -Syyu as this will refresh all the packages.


Try the following command:

pacman -S jre7-openjdk

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)


OpenJDK is a dependency on multiple Arch Linux packages so just installing Oracle’s JDK wasn’t enough.

First had to remove icedtea-web

sudo pacman -R icedtea-web

Then build Oracle JRE AUR package,

Before installing OracleJRE I had to remove openjdk6 manually and ignore dependencies:

[argy@Freak jre]$ sudo pacman -Rdd openjdk6

Install OracleJRE

sudo pacman -U jre-7u2-1-i686.pkg.tar.xz

Build and Install JDK AUR package:

sudo pacman -U jdk-7u2-1-i686.pkg.tar.xz

Logout and Login so the PATH gets updated and java is installed.