Posts: 4
Joined: Sat Apr 26, 2014 12:25 pm

SWT libraries

Sat Apr 26, 2014 12:37 pm


I'm trying to use ucontrol on my raspberry pi, it's a little java server remote controler. but I got trouble wanting launch it.

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-gtk-3735 in java.library.path
	no swt-gtk in java.library.path
	Can't load library: /home/pi/.swt/lib/linux/arm/
	Can't load library: /home/pi/.swt/lib/linux/arm/
	/home/pi/.swt/lib/linux/arm/ /home/pi/.swt/lib/linux/arm/ cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)

	at org.eclipse.swt.internal.Library.loadLibrary(
	at org.eclipse.swt.internal.Library.loadLibrary(
	at org.eclipse.swt.internal.C.<clinit>(
	at org.eclipse.swt.internal.Converter.wcsToMbcs(
	at org.eclipse.swt.internal.Converter.wcsToMbcs(
	at org.eclipse.swt.widgets.Display.<clinit>(
	at com.negusoft.ucagent.view.MainWindow.<init>(
	at com.negusoft.ucagent.view.MainWindow.main(
I've yet installed libswt-gtk-3java & libswt-gtk-3-jni

then I got this :

Code: Select all

pi@raspberrypi ~ $ ls ~/.swt/lib/linux/arm/

Code: Select all

pi@raspberrypi ~ $ ls /usr/lib/jni/
I don't know how could I get this lib
Someone think it can't works on the arm raspberry pi ?


User avatar
Posts: 42232
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: SWT libraries

Sat Apr 26, 2014 11:11 pm

Anything that's a *.so file is a shared object executable program library. The only way something like that will run on your RPi is if you (or someone else) has built it from source for the ARMV6 with hard float.

You can NOT take a version from a X86 or X86_64 system and expect it to run on a RPi, the processor architecture is entirely different.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
Posts: 20546
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: SWT libraries

Sun Apr 27, 2014 7:33 am

To check if the library is appropriate to the Pi, try

Code: Select all

file /home/pi/.swt/lib/linux/arm/
It should return something like

Code: Select all

/home/pi/.swt/lib/linux/arm/ ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xdf28690071a41cb7384a5edf6f98d1d044e500fc, stripped
It won't be exactly the same (because I don't have that file and ran the "file" command on something else), but the important bit is "ARM" rather than "Intel 80386" or "AMD x64" or anything else. Even so, if you just downloaded an "ARM" version of the software it might not be compatible with the specific ARM chip on the Raspberry Pi.

Can you tell us where you downloaded it from?

PS. If you get a "bash: file: command not found" message, you need to install "file" with "sudo apt-get update && sudo apt-get install file"

Posts: 2
Joined: Sat Jun 04, 2016 5:31 pm

Re: SWT libraries

Sat Jun 04, 2016 5:50 pm

I know that this thread is old, but after some attempts I succeeded in running SWT applications on Raspbian Jessie:
  1. Install the following packages (sudo apt-get install):
    • libswt-gtk-4-java
  • copy /usr/lib/java/swt-gtk-<version>.jar file in the application's classpath.
Make sure there are no other swt.jar libraries in the classpath.

Return to “Troubleshooting”