This question already has an answer here:
- Install Java JDK and JRE on Debian 8 3 answers
I am trying to install JDK 8 on Debian. I found a lot of similar topics but none of them solved my problem. In most topics the solution was this commands
sudo apt-get install software-properties-common sudo apt-get install python-software-properties sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk
But I got this error
Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: openjdk-8-jdk : Depends: openjdk-8-jre (= 8u111-b14-2~bpo8+1) but it is not going to be installed Depends: openjdk-8-jdk-headless (= 8u111-b14-2~bpo8+1) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
I also checked for updates
sudo update-alternatives --config java
and the output was
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java Nothing to configure.