简体   繁体   中英

android java.lang.UnsatisfiedLinkError

Background:

I'm running Ubuntu 14.04 in a VirtualBox VM and I am trying to set up some dependencies in order to start playing around with the PhoneGap framework. Namely Java SE and Android SDK. First, I installed the Android SDK by following this tutorial: http://dasunhegoda.com/installrun-phonegap-ubuntu/797/ (at step 5). Then, I realized I didn't have Java SE so I followed this tutorial: http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux .

The Problem:

After I installed the Android SDK, I could easily run the command to open up the SDK manager. After installing the Java SE, I get the error :

Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3550 or swt-pi-gtk in swt.library.path, java.library.path or the jar file
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:403)
at com.android.sdkmanager.Main.doAction(Main.java:391)
at com.android.sdkmanager.Main.run(Main.java:151)
at com.android.sdkmanager.Main.main(Main.java:117)

I assume that this has something to do with the fact that I removed some version of OpenJDK in order to install Java, as per the tutorial. I've tried to search for this error, with all the fixes suggesting the command:

sudo mount -o remount,exec /tmp

After which I get an error saying:

mount: /tmp not mounted or bad option

Any ideas on how to resolve this?

Solved thanks to this thread: Eclipse cannot load SWT libraries

"Because I had installed the Oracle Java 7 it had changed the default Java to Oracle Java 7, however it needed to be the Open JDK.

To fix, open up terminal and type

sudo update-alternatives --config java

This brings up a list of the different types of Java. Simply select the Open JDK."

On Gallium OS

cd /tmp
chmod +x swtlib-64

Then when you do:

android

SDK Manager shows up.. Cheers.

I worked with an older Android installation and Java headless in a container. Installing package libswt-gtk-3-java solved it for me

apt-get install libswt-gtk-3-java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM