我正在尝试启动Java:
$ java -version
java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
$ ldd /usr/lib/jvm/java-6-openjdk/jre/bin/java
linux-gate.so.1 => (0xb779f000)
libz.so.1 => /usr/lib/libz.so.1 (0xb7780000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7767000)
libjli.so => /usr/lib/jvm/java-6-openjdk/jre/bin/../lib/i386/jli/libjli.so (0xb7762000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb775e000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7603000)
/lib/ld-linux.so.2 (0xb77a0000
$ ls /usr/lib/jvm/java-6-openjdk/jre/bin/../lib/i386/jli/
libjli.so
但是java在root下工作:
$ sudo java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-2~lenny1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
UPD:
/ usr / lib / jvm / java-6-openjdk / jre / bin / java实际上是我的Java命令:
$ type java
java is hashed (/usr/bin/java)
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jul 14 10:15 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 40 Jul 14 10:36 /etc/alternatives/java -> /usr/lib/jvm/java-6-openjdk/jre/bin/java
UPD2:
我也尝试设置根路径:
$ sudo su
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# exit
$ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ java -version
java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
UPD3:
我尝试过:
# comm -3 <(declare | sort) <(declare -f | sort)
在根下。但是没有适用于Java的环境变量。
UPD4:
strace -f java -version
结果:http : //dumpz.org/67368/
strace -f java -version
并发布输出。