I have Ubuntu 22.04 installed on a Virtualbox VM running on Windows 10.
I have to switch the current version of Java installed on my Ubuntu to Java 17, which is the most recent version guaranteed to work fine with some software I need to use.
So I have tryed to uninstall the actual version of Java (Java 11, and before I did it for Java 18).
In order to do so, I have followed this procedure of @Eric Carvalho.
Unfortuately, It also removed some OS files from Ubuntu, and now my VM does not work well anymore.
Luckily I had a backup of the whole VM on Windows ( C > users > MYUSER > VirtualBox VMs
), so I deleted the modified VM and started anew.
So now, How can I safely upgrade/switch from any version of Java to Java 17 on Ubuntu 22.04 ?