I am trying to run the simulation software comsol but I get an error for a missing swt library
!ENTRY org.eclipse.osgi 4 0 2023-11-24 11:37:41.275
!MESSAGE Application error
!STACK 1
Exception:
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-pi4-gtk-4932r18 in java.library.path
no swt-pi4-gtk in java.library.path
Can't load library: /home/sima/.swt/lib/linux/x86 64/libswt-pi4-gtk-4932r18.so
Can't load library: /home/sima/.swt/lib/linux/x86 64/libswt-pi4-gtk.so
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
Could not load SWT library. Reasons:
no swt-pi4-gtk-4932r18 in java.library.path
no swt-pi4-gtk in java.library.path
Can't load library: /home/sima/.swt/lib/linux/x86 64/libswt-pi4-gtk-4932r18.so
Can't load library: /home/sima/.swt/lib/linux/x86 64/libswt-pi4-gtk.so
Stack trace:
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:342)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:256)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:90)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:164)
at com.comsol.widgets.tk.swt.SWTDisplay.<init>(SourceFile:31)
at com.comsol.widgets.tk.swt.SWTDisplay.e(SourceFile:41)
at com.comsol.widgets.tk.swt.SWTWidgetFactory.b(SourceFile:42)
at com.comsol.widgets.CsToolkitDisplay.<init>(SourceFile:32)
at com.comsol.guiclient.f.<init>(SourceFile:19)
at com.comsol.guiclient.f.a(SourceFile:31)
at com.comsol.guiclient.MainWindow.<init>(SourceFile:146)
at com.comsol.guiclient.MainWindow.createMainWindow(SourceFile:136)
at com.comsol.guiclient.CsClientApplication.a(SourceFile:98)
at com.comsol.gui.CsApplication.startApplication(SourceFile:152)
at com.comsol.guiclient.CsClientApplication.doStart(SourceFile:75)
at com.comsol.util.application.ComsolApplication.doStart(SourceFile:267)
at com.comsol.util.application.CsBaseApplication.start(SourceFile:189)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
I had a similar problem before and I could fix it by loading the freetype libraries.
LD_PRELOAD=/usr/lib/libfreetype.so comsol
The last time I used comsol (about 6 month ago) everything worked fine, now it doesn’t start.
I installed the swt package but I can only find several instance of the pi3 version of the library and not pi4.
Comsol uses its own instance of java
!SESSION 2023-11-24 11:37:32.338 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_265
java.vendor=AdoptOpenJDK
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -install ../..
Command-line arguments: -os linux -ws gtk -arch x86_64 -install ../..
Is this a java, eclipse, arch or comsol problem? I saw that for deb systems you can just install the libraries directly.