问题描述:
执行jar命令,javac命令执行报错
javac: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
jar: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
java:error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
解决方案:
rm -rf /usr/bin/javac
rm -rf /usr/bin/jar
rm -rf /usr/bin/java
然后建立软链
ln -s /usr/local/jdk1.6.0_13/bin/javac /usr/bin/javac
ln -s /usr/local/jdk1.6.0_13/bin/jar /usr/bin/jar
ln -s /usr/local/jdk1.6.0_13/bin/javac /usr/bin/java
分析原因:
原来安装的时候,安装了openjdk,卸载的时候可能这些执行文件没卸载掉.
导致不能使用.
所以将/usr/bin/下的老执行文件删除掉就能执行了.
查找libjli.so文件
find / -name libjli.so
ldd /usr/bin/java
mv /usr/local/jdk1.6.0_13/jre/lib/i386/jli/libjli.so /lib
时间: 2024-10-14 10:53:42