简体   繁体   中英

Updated java installation cannot be located in centos6

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??

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM