Page 1 of 1

Xubuntu 16.04 + Java9:

Posted: Mon Jan 09, 2017 3:47 pm
by ^rooker
[PROBLEM]
Accidentially installed Java 9 on Xubuntu 16.04 (instead of Java 8).
I've removed Java 9, installed Java 8 and wanted to update the symlink using "update-alternatives" (as usual):

Code: Select all

$ sudo apt-get remove openjdk-9-jre-headless
$ sudo update-alternatives --config java
This didn't work as expected and returned the following message:
update-alternatives: warning: /etc/alternatives/java is dangling; it will be updated with best choice
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-9-openjdk-amd64/bin/java
Nothing to configure.
2 things are strange/wrong here:

1) "/usr/lib/jvm" does contain more than just "java-9-openjdk-amd64":

Code: Select all

lrwxrwxrwx   1 root root   20 Okt 27 21:06 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
-rw-r--r--   1 root root 2600 Okt 27 21:06 .java-1.8.0-openjdk-amd64.jinfo
drwxr-xr-x   5 root root 4096 Jän  1 15:23 java-8-openjdk-amd64
drwxr-xr-x   3 root root 4096 Jän  1 15:32 java-9-openjdk-amd64
So why doesn't update-alternatives just offer OpenJDK 8?

2) I've removed Java 9 - so why is the folder still here?
:?


[SOLUTION]
"A solution", but not really a clean one is to simply update the symlink "/usr/bin/java" to point to the Java 8 binary:

Code: Select all

sudo ln -sf /usr/lib/jvm/java-8-openjdk-amd64/bin/java /usr/bin/java 
Yet, I'm still feeling a bit uncomfortable having Java9-leftovers on my system - and an obviously confused "update-alternatives"...

Re: Xubuntu 16.04 + Java9:

Posted: Mon Jan 09, 2017 10:57 pm
by gilthanaz
Have you tried:

Code: Select all

$ sudo apt-get purge <packagename>
$ sudo apt-get autoremove
$ sudo apt-get autoclean