1

On Ubuntu 20.04 LTS, I've done:

sudo apt-get install openjdk-{8,11,14}-{jdk,source,doc}

Now I often use the commands

sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javadoc

...and maybe a few others, but when I type this command:

ls -l /etc/alternatives/*j*

I still find many Java-related commands which have not been affected by the above sequence of update-alternatives commands.

What is the full list of update-alternatives commands that will change every single Java-related command to a specified Java version?

DodgyCodeException
  • 5,963
  • 3
  • 21
  • 42

1 Answers1

2

While this can be a problem for many software, this is a specific problem for Java on Ubuntu. Fortunately there is a specific solution, a program, call:

update-java-alternatives

I have just use it the following way:

sudo update-java-alternatives -s java-1.14.0-openjdk-amd64

It have change the alternatives of most of the Java related tools.

More comment on this subject can be found on askubuntu for a similar question. This question is also related, and an answer link to the same program.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Galigator
  • 8,957
  • 2
  • 25
  • 39