This question already has an answer here:

I am searching for a package of openjdk but i can't find it, every time gives me this response " sudo apt-get install openjdk-7-jdk Reading package lists... Done Building dependency tree
Reading state information... Done Package openjdk-7-jdk is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'openjdk-7-jdk' has no installation candidate" how to solve this ?

marked as duplicate by steeldriver, Pilot6, Kevin Bowen, David Foerster, muru Feb 15 '17 at 14:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


If you just need OpenJDK in general and not specifically version 7, run:

sudo apt install openjdk-8-jdk

for the whole JDK or:

sudo apt install openjdk-8-jre

for just the runtime for running applications that use Java (e.g. Minecraft). If you need version 7 specifically, see How do I install openjdk 7 on Ubuntu 16.04 or higher?.

Not the answer you're looking for? Browse other questions tagged or ask your own question.