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
@boysingwong
Copy link

Thanks for this guide, i setup oracle jdk8 on Manjaro

@MLK97
Copy link

MLK97 commented Jul 21, 2020

Thank you for this guide.
There are some issues I encountered so for anyone following this guide as well and having trouble installing it:
You might need to replace the md5sum as well as the sha256sum for the .tar.gz file.
You can do this by generating your own via the terminal
For md5sum do:

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

For sha256sum do:

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

If this still doesn't work check if the version you are using - in this guide's case 212 - is uncommented in the first few lines of PKGBUILD while other versions like 231 for example are commented. In my case those were in line 8 of the PKGBUILD

@luoiliembac
Copy link

You have just saved my day!
Thank you very much!

@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