Skip to content

Instantly share code, notes, and snippets.

@RavinduSachintha
Created April 21, 2019 09:15
Show Gist options
  • Save RavinduSachintha/1b41eeed5e1fcb84ec71f2e26854274e to your computer and use it in GitHub Desktop.
Save RavinduSachintha/1b41eeed5e1fcb84ec71f2e26854274e to your computer and use it in GitHub Desktop.
Description about how to install Oracle JDK8 on Arch Linux OS.

Date : 21 / 04 / 2019

I thought to write this gist due to the difficulties which I had to face when installing Oracle Java Development Kit to my Arch Linux OS. At this moment, AUR links not working for installations because of direct downloads are no longer available. You have to create an Oracle account, download, and put in with the PKGBUILD.

This solution will work with Arch Linux and Manjaro.

Now let's do it.

  1. Its probably easiest to just do it manually instead of trying to dance with an automated helper and its directories.
cd ~/Downloads && git clone https://aur.archlinux.org/jdk8.git
  1. Now you should have a jdk8 folder in Downloads. Move that ".tar.gz" which you downloaded from oracle to that folder, If it is also in downloads, and I got the filename right, the command would be like this.
mv ~/Downloads/jdk-8u212-linux-x64.tar.gz ~/Downloads/jdk8/
  1. Now we will enter the jdk8 folder and should edit the PKGBUILD.
cd jdk8 && nano PKGBUILD
  1. The source line we want to change from is....
"https://download.oracle.com/otn-pub/java/jdk/${pkgver}-${_build}/${_hash}/${_pkgname}-${pkgver}-linux-x64.tar.gz"

to the filename we now have in folder,

jdk-8u212-linux-x64.tar.gz
  1. Save and exit the PKGBUILD. Now we can build and install from within that directory.
makepkg -sric
  1. If everything looks like it went fine you can just remove that directory when you are done.
cd ~ && rm -r ~/Downloads/jdk8
@itsspriyanshu
Copy link

Thanks for this, just a update, You no longer need to modify PKGBUILD as you can just download jdk-8u301-linux-x64.tar.gz and keep it in the ~/Downloads folder and just go ahead and build the package it will check for md5sum and will go ahead and install it

@adhiraj2001
Copy link

sha256sum jdk-8u212-linux-x64.tar.gz

Yeah, this made it work for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment