CentOS安装的问题eclipse

本文将指导您如何解决在Linux环境下安装Eclipse时遇到的错误:failed to load the jni shared library。主要通过修改配置文件来禁用SELinux,包括编辑/etc/sysconfig/selinux文件,将其从SELINUX=enforcing更改为SELINUX=disable,或者执行命令setenforce 0来临时关闭SELinux。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在启动eclipse的时候出现错误:

failed to load the jni shared library"/usr/local/java/jdk1.6.0_21/bin/../jre/lib/i386/client/libjvm.so


百度一把,全部人都一样的结果:

在Linux下安装Eclipse出现如下错误

failed to load the jni shared library"/usr/local/java/jdk1.6.0_21/bin/../jre/lib/i386/client/libjvm.so

解决方法:关闭selinux即可解决。

# vi /etc/sysconfig/selinux

修改:SELINUX=enforcing 为:SELINUX=disable 禁用SeLinux, 再重启运行即可

如果不想重启,执行命令:setenforce 0

就可以不重启关闭selinux了

禁用SeLinux有风险,还有其他办法可以解决滴,一个哥们说到:

SELinux is preventing /usr/local/eclipse/eclipse from loading /usr/local/jdk1.6.0_02/jre/lib/i386/client/libjvm.so which requires text relocation.Detailed DescriptionThe /usr/local/eclipse/eclipse application attempted to load /usr/local/jdk1.6.0_02/jre/lib/i386/client/libjvm.so which requires text relocation. This is a potential security problem. Most libraries do not need this permission. Libraries are sometimes coded incorrectly and request this permission. The SELinux Memory Protection Tests web page explains how to remove this requirement. You can configure SELinux temporarily to allow /usr/local/jdk1.6.0_02/jre/lib/i386/client/libjvm.so to use relocation as a workaround, until the library is fixed. Please file a bug report against this package.Allowing AccessIf you trust /usr/local/jdk1.6.0_02/jre/lib/i386/client/libjvm.so to run correctly, you can change the file context to textrel_shlib_t. "chcon -t textrel_shlib_t /usr/local/jdk1.6.0_02/jre/lib/i386/client/libjvm.so"

The following command will allow this access:  chcon -t textrel_shlib_t /usr/local/jdk1.6.0_02/jre/lib/i386/client/libjvm.so

请注意画线的提示,它提示我们如果想允许eclipse访问那个目录,使用这个命令。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值