/Locating-Java-Path-in-Ubuntu-

we are going to see how to access java path from ubuntu

Locating-Java-Path-in-Ubuntu-

we are going to see how to access java path from ubuntu. IF you get an error on your terminal because your system cannot locate your java path, then follow the steps bellow.

0- Try this link first: copy and paste into your linux terminal

readlink -f /usr/bin/java | sed "s:bin/java::"

if doesn't work for you then, try the steps bellow.

1 - Open your terninal with Ctrl+Alt+T

2- Log in as root by typing: sudo su , and enter your password.

3- When connected as a root, type in: sudo updatedb (notice that there is a "b" at the end) and press Enter

4- Type: locate openjdk , and press Enter

5-You will see something like this:

/usr/lib/jvm/java-11-openjdk-amd64/lib/libfontmanager.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libinstrument.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libj2gss.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libj2pcsc.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libj2pkcs11.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjaas.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjava.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjavajpeg.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjawt.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjdwp.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjimage.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjsig.so /usr/lib/jvm/java-11-openjdk-amd64/lib/libjsound.so /usr/lib/jvm/java-11-openjdk-amd64/lib/liblcms.so

6- Copy any ligne from "/usr/ ...to amd64" , it doesn't matter which ligne you copy , just start from the beginning and stop at amd64

7- Example: the java path here will be :

/usr/lib/jvm/java-11-openjdk-amd64 (i did copy the first ligne, it would be the same for any ligne that i copy)

That's it for locating our JAVA PATH. Thanks for reading