Home > Back-end >  How to find the JRE location to use the system JRE in eclipse
How to find the JRE location to use the system JRE in eclipse

Time:03-08

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.

CodePudding user response:

Using which will give you /usr/bin/java which won't help as it will be a symlink. You need something like

readlink -f $(which java)

CodePudding user response:

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
  • Related