在RedHat Linux5 中安装JDK1.7时,当我解压jdk,并且配置好了环境变量,测试的时候,报以下错误。
[root@jingfeng01 ~]# java -version
Error: dl failure on line 863
Error: failed /usr/java/jdk1.7.0_60/jre/lib/i386/client/libjvm.so, because /usr/java/jdk1.7.0_60/jre/lib/i386/client/libjvm.so: cannot restore segment prot after reloc: Permission denied
在网上找了找错误,最后发现原来是SELinux的缘故,关闭SELinux即可解决
解决方案:
[root@jingfeng01 ~]# vi /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
将SELINUX=enforcing 改为SELINUX=disabled 关闭,然后重启机器,让其生效