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

SWT libraries

Sat Apr 26, 2014 12:37 pm

hi,

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/libswt-gtk-3735.so
	Can't load library: /home/pi/.swt/lib/linux/arm/libswt-gtk.so
	/home/pi/.swt/lib/linux/arm/libswt-gtk-3735.so: /home/pi/.swt/lib/linux/arm/libswt-gtk-3735.so: 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(Library.java:285)
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
	at org.eclipse.swt.internal.C.<clinit>(C.java:21)
	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 com.negusoft.ucagent.view.MainWindow.<init>(MainWindow.java:72)
	at com.negusoft.ucagent.view.MainWindow.main(MainWindow.java:105)
I've yet installed libswt-gtk-3java & libswt-gtk-3-jni

then I got this :

Code: Select all

[email protected] ~ $ ls ~/.swt/lib/linux/arm/
libswt-atk-gtk-3833.so  libswt-awt-gtk-3833.so  libswt-gtk-3833.so  libswt-pi-gtk-3833.so
&

Code: Select all

[email protected] ~ $ ls /usr/lib/jni/
libswt-atk-gtk-3833.so  libswt-awt-gtk-3833.so  libswt-gtk-3833.so  libswt-pi-gtk-3833.so
I don't know how could I get this lib libswt-gtk-3735.so
Someone think it can't works on the arm raspberry pi ?


Thanks.

User avatar
DougieLawson
Posts: 34774
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

User avatar
rpdom
Posts: 13571
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/libswt-gtk-3735.so
It should return something like

Code: Select all

/home/pi/.swt/lib/linux/arm/libswt-gtk-3735.so: 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"

Albertus
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
      libswt-cairo-gtk-4-jni
  • 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”