无法在 Ubuntu 12.04 中打开 Eclipse - java.lang.UnsatisfiedLinkError:无法加载 SWT 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10970754/
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
Can't OPEN Eclipse in Ubuntu 12.04 - java.lang.UnsatisfiedLinkError: Could not load SWT library
提问by Ramprasad
I have installed Ubuntu 12.04 newly. Also i installed Java 7. I try to install eclipse-java-indigo-SR2-linux-gtk.tar.gz. i extracted this file in /home/ramprabhu location. Then i try to run eclipse executable file. I got error as see the log file.
我新安装了 Ubuntu 12.04。我还安装了 Java 7。我尝试安装 eclipse-java-indigo-SR2-linux-gtk.tar.gz。我在 /home/ramprabhu 位置解压了这个文件。然后我尝试运行 eclipse 可执行文件。我看到日志文件时出错。
My log file:
我的日志文件:
!SESSION 2012-06-10 22:47:35.959 -----------------------------------------------
eclipse.buildId=M20120208-0800
java.version=1.7.0_04
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.osgi 4 0 2012-06-10 22:47:36.757
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/home/ramprabhu/eclipse/configuration/org.eclipse.osgi/bundles/247/1/.cp/libswt-pi-gtk-3740.so: libXtst.so.6: cannot open shared object file: No such file or directory
no swt-pi-gtk in java.library.path
/home/ramprabhu/.swt/lib/linux/x86/libswt-pi-gtk-3740.so: /home/ramprabhu/.swt/lib/linux/x86/libswt-pi-gtk-3740.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
Can't load library: /home/ramprabhu/.swt/lib/linux/x86/libswt-pi-gtk.so
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:695)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:153)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:95)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
I am not able to run eclipse. How to solve this problem and run eclipse.
我无法运行日食。如何解决这个问题并运行eclipse。
采纳答案by Andrew T Finnell
You are mixing 64-bit and 32-bit. Download the 64-bit version of Eclipse and use the 64-bit version of Java 7.
您正在混合 64 位和 32 位。下载 64 位版本的 Eclipse 并使用 64 位版本的 Java 7。
回答by Andres Mora
Try with the following command
尝试使用以下命令
64 Bits System:
ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/
32 Bits System:
ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/
64位系统:
ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/
32位系统:
ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/
回答by Rakib
worked it out by copying the libswt
files to ~/.swt/lib/linux/x86(or x86_64)
通过将libswt
文件复制到~/.swt/lib/linux/x86(or x86_64)
for 32 bit:
对于 32 位:
/bin/cp /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/
for 64 bit:
对于 64 位:
/bin/cp /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/
回答by Dmitry Bespalov
I came across this error when tried to start 32-bit build of Eclipse under 64-bit linux. The problem was solved after installing ia32-libspackage.
尝试在 64 位 linux 下启动 32 位 Eclipse 构建时遇到此错误。安装ia32-libs包后问题解决。
回答by CAMOBAP
I faced with this problem after installing QNX Momentic IDE (it based on 32-bit eclipse distribution) for Blackberry 10 development. I haven't chance to install ia32-libs because
在为 Blackberry 10 开发安装 QNX Momentic IDE(它基于 32 位 eclipse 发行版)后,我遇到了这个问题。我没有机会安装 ia32-libs 因为
$ sudo apt-get install ia32-libs Reading package lists... Done Building dependency tree
Reading state information... Done Package ia32-libs is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: lib32asound2 lib32z1 lib32ncurses5 lib32bz2-1.0E: Package 'ia32-libs' has no installation candidate
$ sudo apt-get install ia32-libs 读取包列表...完成 构建依赖树
读取状态信息...完成 包 ia32-libs 不可用,但被另一个包引用。这可能意味着该软件包丢失、已过时或只能从其他来源获得,但是以下软件包替换了它:lib32asound2 lib32z1 lib32ncurses5 lib32bz2-1.0E: 包 'ia32-libs' 没有安装候选
I found solution in this post
我在这篇文章中找到了解决方案
sudo aptitude install libc6:i386 libstdc++6:i386 libatk1.0-0:i386 libc6:i386 libcairo2:i386 libexpat1:i386 libffi6:i386 libfontconfig1:i386 libfreetype6:i386 libgcc1:i386 libgdk-pixbuf2.0-0:i386 libglib2.0-0:i386 libgtk2.0-0:i386 libpango1.0-0:i386 libpcre3:i386 libpixman-1-0:i386 libpng12-0:i386 libselinux1:i386 libstdc++6:i386 libx11-6:i386 libxau6:i386 libxcb1:i386 libxcb-render0:i386 libxcb-shm0:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxrandr2:i386 libxrender1:i386 libxtst6:i386 zlib1g:i386
sudo aptitude install libc6:i386 libstdc++6:i386 libatk1.0-0:i386 libc6:i386 libcairo2:i386 libexpat1:i386 libffi6:i386 libfontconfig1:i386 libfreetype6:i386 libgcc1.0-0:i386 .0-0:i386 libgtk2.0-0:i386 libpango1.0-0:i386 libpcre3:i386 libpixman-1-0:i386 libpng12-0:i386 libselinux1:i386 libstdc++6:i386 libx11-6:i63 :I386 libxcb1:I386 libxcb-render0:I386 libxcb-shm0:I386 libxcomposite1:I386 libxcursor1:I386 libxdamage1:I386 libxdmcp6:I386 libxext6:I386 libxfixes3:I386 libxi6:I386 libxinerama1:I386 libxrandr2:I386 libxrender1:I386 libxtst6:I386的zlib1g: i386
I'm sure this solution will help with simple 32-bit eclipse also
我相信这个解决方案对简单的 32 位 eclipse 也有帮助
回答by Abdellah Alaoui
Here is how i solved the issue
aptitude search libswt-gtk
这是我解决问题的方法
aptitude search libswt-gtk
Then sudo apt-get install
the ones not installed
然后sudo apt-get install
那些没有安装
回答by johng
had the same problem with with my 64bit system, the ln is solution worked, magic, 64 Bits System: ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/
我的 64 位系统也有同样的问题,ln 是解决方案,神奇的,64 位系统:ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/