'How to find the JRE location to use the system JRE in eclipse

I'm trying to set up a java project to use openjdk-11 and all the answers I have found so far have me going in circles. I'm using ubuntu 20.04, so I used the command 'sudo apt install openjdk-11-jre'. The installation seemed to be successful but now I can't seem to figure out the file path to the installed JRE.
I thought it would be under /user/lib/jvm/java-11-openjdk-amd64 somewhere. When I point eclipse to that location and try to search for a JRE however it doesn't find anything.

I have found lots of examples with info on how to install but nothing about how to track down the exact file path.
Any help would be greatly appreciated.

Update While I was able to find the JRE location, the root problem turns out to be eclipse. I forgot I had an older version (4.6) open since that is what the project was originally using. Once I switched over to 4.18 I was able to add the java 11 JRE.



Solution 1:[1]

you can use the following:

update-alternatives --list java

will gives you something similar to the below:

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tricksSpecialist