I tried running the command in Ubuntu 16.04:
sudo apt-get install oracle-java7-installer oracle-java7-set-default
but it's showing an error:
How can I install this package?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Oracle JDK 6 and 7 are not available by default in Ubuntu 16.04 repositories and requires you to add repositories for the same as follows:
$ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update
You may now run your command and enjoy using Java.
If you get error while installing ppa:repository, you will need to re-install ca certificates as follows:
$ sudo apt-get install --reinstall ca-certificates
Once this is done try running first two commands again.