Updated java installation cannot be located in centos6

133 Views Asked by At

i have to update the Tomcat from 7 to 9 as per VAPT requirements, so i did that on my centos6 linux server. But the tomcat 7 was running with java 1.7 openjdk and when i start tomcat 9 there are no logs.

I researched and realised i need to use a newer java version. So i did yum java update and installed jdk 11 . But the echo JAVA_HOME is empty on the server. How can i find the installation directory or this new java in my os?

I checkthe old java version was at /usr/java but new one is not there or around it. What is the default installation of java in centos6 ??

2

There are 2 best solutions below

0
Monali Ghotekar On BEST ANSWER

To get all installed java version give command : sudo alternatives --config java , this will list all available java version and you can set default by choosing the correct one. you will also get the actual installation path corresponding to each version and can set your java_home accordingly.
For more information you can refer here

1
Veselin Perović On

From the command line run this:

which java

As a result you should get something like this:

/usr/bin/java

After that run the command:

ls -al /usr/bin/java

and you should get result like this:

lrwxrwxrwx     8 user  13 Jan  2022 java -> path_to_your_java_instalation

The file on the path /urs/bin/java is a symbolic link