Score:0

How can I figure out which package currently provides a command?

br flag

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?

hr flag
Your title seems to be asking about [Finding out what package a command came from](https://askubuntu.com/questions/13792/finding-out-what-package-a-command-came-from) but I suspect that's not the real issue here
Eduardo Wada avatar
br flag
@steeldriver you are correct, the reason I asked about where it comes from is because I know how to fix the real issue from there by uninstalling the package and installing the correct package, DynamicBits answer on keeping two simultaneous versions does help me though and the reason I didn't accept it is simply because I didn't test it yet, and the link you provided gives exactly what I was originally looking for.
Score:0
in flag

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*".

Eduardo Wada avatar
br flag
the `sudo update-alternatives --config java` actually just didn't work for me, it doesn't detect any other alternative, the `apt list --installed "*jdk*"` was enough for me to figure it out though
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.