0

I have a .jar that I complied and exported on Windows via Eclipse. It runs perfectly and now I wish to run it on a Solaris 10 machine.

When I attempt to run it on Solaris, however, I get a java.lan.UnsatisifiedLinkError complaining it could not load a SWT library.

Exception in thread "main" java.lang.UnsatisifiedLinkError: Could not load SWT library.  Reasons:
no swt-win32-3650 in java.library.path
no swt-win32 in java.library.path
Can't load library: /var/tmp/swtlib-64/libswt-win32-3650.so
Can't load library: /var/tmp/swtlib-64/libswt-win32-3650.so

Why is Java looking for libswt-win32 libraries? Am I creating the .jar wrong?

Do I need to export the .jar differently when I build on Windows since its now intended to be run from Solaris?

lolololol ol
  • 848
  • 1
  • 8
  • 18
  • 2
    You need a separate jar per platform containing the platform specific version of SWT. See [this question](https://stackoverflow.com/q/23359351/2670892) – greg-449 Jun 30 '18 at 08:33

1 Answers1

1

SWT has a native component. I presume that you are using something from it for it to be included. You will need to have the equivalent native library installed on your Solaris system.

Have a look at the solutions here, it is on Ubuntu, but problem is similar:

Eclipse cannot load SWT libraries

jbx
  • 21,365
  • 18
  • 90
  • 144
  • I looked at those answers previously, but none really pertain to my question. My problem is a platform issue, whereas that question's problem is a loading issue (i.e. the solution was just to symlink where java was looking to where it should be looking). – lolololol ol Jun 29 '18 at 21:29