Xubuntu 16.04 + Java9:

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....

Xubuntu 16.04 + Java9:

Postby ^rooker » Mon Jan 09, 2017 3:47 pm

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?

"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"...
  • 0

Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
Site Admin
Posts: 1444
Joined: Fri Aug 29, 2003 8:39 pm
Reputation: 0

Re: Xubuntu 16.04 + Java9:

Postby gilthanaz » Mon Jan 09, 2017 10:57 pm

Have you tried:

Code: Select all
$ sudo apt-get purge <packagename>
$ sudo apt-get autoremove
$ sudo apt-get autoclean
  • 0

User avatar
Site Admin
Posts: 443
Joined: Fri Aug 29, 2003 9:29 pm
Reputation: 0

Return to Knowledge Base

Who is online

Users browsing this forum: No registered users and 4 guests

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: Google [Bot] and 8 guests

Reputation System ©'