Check JDK Directory on CentOS
On CentOS systems, you can use the following command to view the installation directory of JDK:
alternatives --display java
This command will display the links related to the current Java executable file, including information about the JDK installation directory. In the output, look for the path corresponding to java to find the JDK installation directory. Typically, the default installation directory for JDK on CentOS is /usr/lib/jvm/.