Java 错误:libXext.so.6:无法打开共享对象文件:没有这样的文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29741518/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error: libXext.so.6: cannot open shared object file: No such file or directory
提问by Green
I am getting the error below when running a java file that tries to open an ods file.
运行尝试打开 ods 文件的 java 文件时出现以下错误。
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/software/jdk1.6.0_45/jre/lib/i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeL
线程“main”中的异常 java.lang.UnsatisfiedLinkError:/opt/software/jdk1.6.0_45/jre/lib/i386/xawt/libmawt.so:libXext.so.6:无法打开共享对象文件:没有这样的文件或目录在 java.lang.ClassLoader$NativeL
I tried - 'yum install libXext'
but got the msg - already installed.
我试过 -'yum install libXext'
但得到 msg - 已经安装。
Any suggestions?
有什么建议?
Answer:
回答:
do yum install libXstst.so.6 It installs and works fine
do yum install libXstst.so.6 它安装并运行良好
回答by sanelli
First of all you can try to use the following command:
首先,您可以尝试使用以下命令:
yum search libXext
Following this search you will find that you need to install the following library: libXext.i686 (or most probabily libXext.i386). After this you can run:
在此搜索之后,您会发现您需要安装以下库:libXext.i686(或最有可能的 libXext.i386)。在此之后,您可以运行:
sudo yum install libXext.i686
As a side note, I needed also to install the following libraries in order to make my java application to work properly: libXrender.i686 and libXtst.i686. I think that this issue is due to the fact that we are trying to user a java 32bit version on a 64bit OS.
作为旁注,我还需要安装以下库以使我的 java 应用程序正常工作:libXrender.i686 和 libXtst.i686。我认为这个问题是由于我们试图在 64 位操作系统上使用 java 32 位版本。
回答by user3018906
In my case I needed to install additional libs.
就我而言,我需要安装额外的库。
yum install libXext.x86_64
yum install libXrender.x86_64
yum install libXtst.x86_64
回答by liudabao
I think you may installed 32 bit jdk in 64 bit system.if your CentOs is 64 bit, and you installed 32 bit jdk. You will get that error when you run jar
我认为您可能在 64 位系统中安装了 32 位 jdk。如果您的 CentOs 是 64 位,并且您安装了 32 位 jdk。运行 jar 时会出现该错误
you can check CentOs is 32 bit or 64 bit,enter command:
你可以检查 CentOs 是 32 位还是 64 位,输入命令:
getconf LONG_BIT
If the CentOs is 64 bit, then you can remove the 32 bit jdk, and install a new one
如果 CentOs 是 64 位的,那么你可以删除 32 位的 jdk,并安装一个新的
回答by tzHymany
use file command to see if it is 32bit or 64 bit file /opt/software/jdk1.6.0_45/jre/lib/i386/xawt/libmawt.so its output should like:
ELF 32-bit LSB executable
then install corresponding lib for 32 bit:
sudo yum install libXext.i686
for 64 bit:
sudo yum install libXext
使用 file 命令查看它是 32 位还是 64 位文件 /opt/software/jdk1.6.0_45/jre/lib/i386/xawt/libmawt.so 它的输出应该是:
ELF 32 位 LSB 可执行文件
然后为 32 位安装相应的库:
须藤 yum 安装 libXext.i686
对于 64 位:
须藤 yum 安装 libXext
回答by danielpflood
For Arch I used pkgfile (which I installed with pacman) and then ran:
对于 Arch,我使用了 pkgfile(我用 pacman 安装)然后运行:
pkgfile --update
pkgfile libXtst.so.6
and it showed me extra/libxtst.
它向我展示了额外的/libxtst。
I installed with pacman and so far so good.
我安装了 pacman,到目前为止一切顺利。