Unable to Revert to Previous Java/OpenJDK Installs

So I’m trying to reinstall any form of Java be it OpenJDK or whatever through Terminal using

apt install default-jre

or

apt install default-jdk

but I get the message:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

I have deleted every form of Java from my /usr/lib/jvm folder in hopes that when I would place JRE/JDK 7 there, it would register Java 7, but it hasn’t, and now I can’t seem to go back to what I had previously. I was wondering if anyone could help me on this, or if I have to re-install my Ubuntu OS completely.

Had a similar issue before, where I was dependent on the Java llvm interface which only exists for Java 7. Let me just dig through my notes to find the exact steps, but I should 100% be able to help you.

Don’t reinstall the entire OS :slight_smile:

You might try apt reinstall X to refresh the version of X in your system.

K3n.

If Ludger is unable to help and you’re still really stuck, you could try using SDKMAN. It lets you install, switch to, and even temporarily switch defaults for a terminal to a specific JRE. It also manages multiple versions for you and lets you specify which is your OS-default.

The steps would be something like this (first command being from the website above):

curl -s "https://get.sdkman.io" | bash

(close terminal and open a new one)

sdk list java
(this should give you some options, press Q to clear)

sdk install java 7.0.352-zulu
(or whatever version Identifier you prefer)
(then tell it Y, I think, to make it the default)

Maybe it would still fail if something odd is going on for you, but it’s certainly better to try if you’re on the verge of resorting to a reinstall.