0

I'm trying to run a Java program and I'm getting the error "xxx has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0"

However, I have already installed jdk 16.0.2 which I believe should give me the updated version, which means I need to remove my old Java, my question is, how do I figure out which package is my old Java so I can remove it?

1 Answers1

0

You can keep multiple versions installed, but choose which version is the default with the following command:

sudo update-alternatives --config java

To easily verify which version is default, run java --version.

To list all of the installed jdk packages, run apt list --installed "*jdk*".