I tried this answer for Ubuntu 16.10, but after running this
sudo apt-get update
This error happened
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/openjdk-r/ppa/ubuntu yakkety Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/openjdk-r/ppa/ubuntu/dists/yakkety/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
And after trying to install it
sudo apt-get install openjdk-7-jdk
This error occurred
E: Package 'openjdk-7-jdk' has no installation candidate
How can I install openjdk-7 on Ubuntu 16.10?
openjdk-7
is obsolete.