大学IT网 - 最懂大学生的IT学习网站! QQ资料交流群:367606806
当前位置:大学IT网 > Java技巧 > error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

关键词:sharedlibrarieserrorloading  阅读(475) 赞(18)

[摘要]本文是对error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory的讲解,对学习Java编程技术有所帮助,与大家分享。

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/ 添加到文件:/etc/ld.so.conf 中,然后执行ldconfig 即可



相关评论