java 罕见的依赖报错 jstat: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
java 都用了N长时间了,突然,意外地发现有一个依赖的so文件从来没找见过 # ldd /usr/bin/java linux-vdso.so.1 => (0x00007fffba769000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00000038c4000000) libjli.so => not found libdl.so.2 => /lib64/libdl.so.2 (0x0000003da7c00000) libc.so.6 => /lib64/libc.so.6 (0x0000003da7400000) /lib64/ld-linux-x86-64.so.2 (0x0000003da6c00000) 其实这个so文件在java的安装包中是有的,只是没有添加了ld_path 里面,解决办法: # rpm -ql jdk1.8.0_45|grep libjli /usr/java/jdk1.8.0_45/jre/lib/amd64/jli/libjli.so /usr/java/jdk1.8.0_45/lib/amd64/jli/libjli.so 然后,将/usr/java/jdk1.8.0_45/jre/lib/amd64/jli/ 或 /usr/java/jdk1.8.0_45/lib/amd64/jli/