0

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?

Josh
  • 33
  • 4

3 Answers3

1

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."

Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198
Josh
  • 33
  • 4
  • This solution worked for me. No idea how I ended up needing this, but sudo update-alternatives --config java worked, and I selected 0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode – Barrard Mar 03 '17 at 08:40
0

On Gallium OS

cd /tmp
chmod +x swtlib-64

Then when you do:

android

SDK Manager shows up.. Cheers.

Aldanis Vigo
  • 159
  • 2
  • 6
0

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
Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198