Error:Could not load SWT library

在ubuntu 12上面安装eclipse,启动的时候,或许会有如下错误:
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-atk-gtk-3740 in java.library.path no swt-atk-gtk in java.library.path Can't load library: /home/eric/.swt/lib/linux/x86_64/libswt-atk-gtk-3740.so Can't load library: /home/eric/.swt/lib/linux/x86_64/libswt-atk-gtk.s
解决办法如下:
update-alternatives --config java
选择你正确的java版本,当你系统中有多个jdk版本的情况 接着将如下库文件建立软连接
libswt-atk-gtk-3740.so -> /usr/lib/jni/libswt-atk-gtk-3740.so libswt-awt-gtk-3740.so -> /usr/lib/jni/libswt-awt-gtk-3740.so libswt-gtk-3740.so -> /usr/lib/jni/libswt-gtk-3740.so libswt-pi-gtk-3740.so -> /usr/lib/jni/libswt-pi-gtk-3740.so
以上库文件软连接存放地址:/home/meso/.swt/lib/linux/x86_64/ 再打开eclipse,即可正常使用。

你可能感兴趣的:(Error:Could not load SWT library)