JDK gone after upgrading to Ubuntu 16.04

Asked by Renardo

Good time of the day,

This weekend I upgraded Ubuntu 15.10 to 16.04, which turned out to be a very bad idea.

During upgrade the system informed me that several hundred packages were no longer needed and could be uninstalled. I agreed assuming that I could always reinstall anything I need.

When the upgrade was through, all my Eclipse Java projects were dead. I found that my openjdk 6 and 7 (/usr/lib/jvm) were gone, with only openjdk 8 remaining. I develop for older application server versions, so I need those older JDKs.

So I opened what now is in place of the late Ubuntu Software Center and typed "JDK". It told me there were no matches. I tried "Java", no matches either.

I tried "apt-get install openjdk-6-jre", and it told me there was no such installation candidate but the package had been replaced by the following:

 openjdk-6-jre-headless:i386 icedtea-netx:i386 icedtea-netx-common icedtea-netx default-jre-headless default-jre-headless:i386

I tried that but it's an endless loop, I am always told that there is no installation candidate.

This is a, well, serious problem for me. Any ideas would be appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For xenial the official Ubuntu repositories provide only openjdk-8 packages; openjdk-6 and openjdk-7 are no more provided.

But there are PPAs, e.g. https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa

see also see also Bug #1563986 and https://answers.launchpad.net/ubuntu/+question/291842

Revision history for this message
Renardo (renardo) said :
#2

Thank you for pointing out these PPAs (which I had not known). I did the following:

 $ sudo add-apt-repository ppa:openjdk-r/ppa
 $ sudo apt-get install openjdk-6

A file named /etc/apt/sources.list.d/openjdk-r-ubuntu-ppa-xenial.list was created but the result of apt-get was (translated): "package openjdk-6 not found". Same for "openjdk-7".
"Ubuntu Software" still finds no results for "JDK". "sudo aptitude search jdk" returns things such as "openjdk-7-jre-headless" but "sudo apt-get install openjdk-7-jre-headless" says "no installation candidate".

What am I doing wrong?

If there is a way to get Eclipse (3.8) going with JDK 8 I would also be interested. What bewilders me is that Eclipse starts and displays Java projects (with "java-nature") but all Java-related items in the properties are missing.

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#3

I assume that the package that you need to install is openjdk-7-jdk or openjdk-7-jre

What is the output of the commands
sudo apt-get update
sudo apt-get install openjdk-7-jdk

Note, that this PPA does not provide an openjdk-6 version for xenial, (but I haven't done a complete search in other PPAs).

The eclipse version currently available for Ubuntu is already a bit dated. Newer versions available for download from eclipse.org are supposed to work with opebjdk-8. So delivering a more recent version of eclipse in Ubuntu could probably also solve one of your problems. see also Bug #1019273

Revision history for this message
Renardo (renardo) said :
#4

Strange as it may seem, I really need jdk 6 (jdk 7 added so many abstract methods to libraries that break my applications). I got it through my Oracle account in the meantime.

You are right, installing openjdk-7-jdk with apt-get worked. It's just that on the PPA's web page I had seen an "openjdk-6" so I though it might work, too.

OK, this problem is solved by my Oracle Account but my Eclipse (3.8) still does not remember anything about Java, Ant, etc. So this morning I got Eclipse Mars. It's preferences dialogue does not work at all, and I have found that I am not the only one with this problem.

I now have activated the Windows installaton I had to buy together with my computer. I had never touched it, and Grub had serious problems finding it after several Ubuntu updates (I had to look under "System setup", "Boot from EFI"). That's not pretty but at least it works.

I assume there is nothing more to be done. Eclipse's reputation is not excellent but from what I see on the web the combination Linux+Eclipse is really nothing to recommend.

Thanks for your help.

Revision history for this message
Renardo (renardo) said :
#5

Thanks Manfred Hampl, that solved my question.