How to install jdk 8 on ubuntu

Uninstall any java openjdk or old jdk from the system
$ sudo apt-get purge openjdk*
$ sudo apt-get purge oracle-java*

Install java PPA repository to the system
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Setup java environment
$ sudo apt-get install oracle-java8-set-default

No comments:

Post a Comment