解决 /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Centos7 安装好 zabbix-java-gateway 之后,自带的openjdk版本如下:

[root@tomcat01 ~]# java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)
[root@tomcat01 ~]# which java
/usr/bin/java
[root@tomcat01 ~]# ll /usr/bin/java 
lrwxrwxrwx 1 root root 22 Feb 12 12:58 /usr/bin/java -> /etc/alternatives/java

配置好jdk之后

tail -8 /etc/profile
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

export CATALINA_HOME=/usr/local/tomcat
export CLASSPATH=.:$JAVA_HOME/lib:$CATALINA_HOME/lib
export PATH=$PATH:$CATALINA_HOME/bin

中途安装了一个tomcat-jsp-2.2-api软件包后又卸载了

报错:

[root@tomcat01 local]# java -version
-bash: /usr/local/jdk/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

解决:

[root@tomcat01 ~]# yum install glibc.i686 -i
[root@tomcat01 ~]# java -version
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) Client VM (build 25.321-b07, mixed mode)
[root@tomcat01 ~]# rpm -qa glibc
glibc-2.17-325.el7_9.x86_64
glibc-2.17-325.el7_9.i686
[root@tomcat01 ~]# 

posted @ 2022-02-14 15:34  91key  阅读(1159)  评论(0编辑  收藏  举报