ObeoNetwork / UML-Designer

OpenSource (EPL licensed) UML2 Graphical Modelers (Class, Composite, State, Activity, Sequence ...)
http://umldesigner.org
317 stars 122 forks source link

UML Designer 9 - Can't load library: libswt-pi3-gtk.so #1060

Open ruddy32 opened 4 years ago

ruddy32 commented 4 years ago

Hi, Starting UML Designer 9 on ArchLinux shows following message :

Can't load library: /home/.../.swt/lib/linux/x86_64/libswt-pi3-gtk-4763.so
Can't load library: /home/.../.swt/lib/linux/x86_64/libswt-pi3-gtk.so 

Previous version of UML Designer was package with libswt-pi3-gtk.so library. This is not the case for UML Designer 9. Is it normal ? Regards.

plibither8 commented 3 years ago

No response :(

feheleno commented 2 years ago

It's been a while but let me put my workaround here so if someone with the same problem happens to find this thread he/she can try to make it work the same way I did

First of all my setup:

Fedora 34 - 5.14.17-201.fc34.x86_64 

openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment 21.9 (build 17.0.1+12)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12, mixed mode, sharing)

My stacktrace shows as following

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
        /home/f148580/programas/UMLDesigner/configuration/org.eclipse.osgi/349/0/.cp/libswt-pi3-gtk-4763.so: 
/lib64/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var
        no swt-pi3-gtk in java.library.path
        /home/f148580/.swt/lib/linux/x86_64/libswt-pi3-gtk-4763.so: /lib64/libfontconfig.so.1: 
undefined symbol: FT_Done_MM_Var
        Can't load library: /home/f148580/.swt/lib/linux/x86_64/libswt-pi3-gtk.so
        ...

It looks like the program can't load the libswt-pi3-gtk.so, but it actually find a undefined symbol _FT_Done_MMVar when it's expecting a defined one, as it seems.

I came to that conclusion reading this thread and as they point out it's some problem with the freetype lib. And in this thread https://github.com/prusa3d/PrusaControl/issues/115#issue-376928911 I found out how she dealt with her problem, and as it was solved with just preloading the freetype lib I thought it could work with UMLDesigner too.

So if your stacktarce is the same as mine then it's simple, you just preload the libfreetype.so like this:

$ LD_PRELOAD=/usr/lib64/libfreetype.so ./UMLDesigner

Now there were some things I did before getting to that solution and I don´t know if they are having unintended effects here, so I'm explainig all I did for completeness sake, but I undid everything I'm explaining below:

First I thought I didn´t have the libswt-pi3-gtk-4763.so, so I installed eclipse-swt

$ sudo dnf install eclipse-swt

I missed it because it is located in a hidden directory: _/home/f148580/.swt/lib/linux/x8664/libswt-pi3-gtk-4763.so

Then, because the error pointed to a libswt-pi3-gtk.so that I couldn't find anywhere, I went to that directory and created a symlink like this:

$ ln -s ./libswt-pi3-gtk-4763.so ./libswt-pi3-gtk.so

And I also did some customization in the UMLDesigner.ini file following https://github.com/ObeoNetwork/UML-Designer/issues/971#issuecomment-518806186