angryip / ipscan

Angry IP Scanner - fast and friendly network scanner
angryip.org
GNU General Public License v2.0
4.07k stars 713 forks source link

`Cannot load 64-bit SWT libraries on 32-bit JVM` Raspberry Pi #322

Open cycool29 opened 2 years ago

cycool29 commented 2 years ago

Describe the bug

Every time when I launch Angry IP Scanner, it shows Cannot load 64-bit SWT libraries on 32-bit JVM error. Installed from the DEB package from the download page.

Tried to launch from JAR file, same error.

Tried to build from source, it says I don't have org.eclipse.swt package.

This error only shows on Raspbian bullseye, on buster it works well.

To Reproduce

Steps to reproduce the behavior:

  1. Get a Raspberry Pi and install the latest bullseye image
  2. Download the DEB package and install
  3. Launch it from terminal: ipscan
  4. See error.

Expected behavior

Angry IP Scanner launch normally.

Screenshots

image

Versions (please complete the following information):

Logs:

java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:276)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:256)
    at org.eclipse.swt.internal.C.<clinit>(C.java:19)
    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:161)
    at net.azib.ipscan.gui.GUI.<init>(GUI.java:29)
    at net.azib.ipscan.Main.main(Main.java:47)
angryziber commented 2 years ago

On ARM cpu you need to install the any architecture package and install swt packages from your distro.

This is untested by me, so please write back how it goes.

cycool29 commented 2 years ago

I've installed all packages in regex libswt*, still not working.

pi@raspberrypi:~ $ sudo apt search libswt

Sorting... Done
Full Text Search... Done
libswt-cairo-gtk-4-jni/stable,now 4.13.0-1+b2 armhf [installed]
  Standard Widget Toolkit for GTK+ Cairo JNI library

libswt-glx-gtk-4-jni/stable,now 4.13.0-1+b2 armhf [installed]
  Standard Widget Toolkit for GTK+ GLX JNI library

libswt-gtk-4-java/stable,now 4.13.0-1+b2 armhf [installed]
  Standard Widget Toolkit for GTK+ Java library

libswt-gtk-4-jni/stable,now 4.13.0-1+b2 armhf [installed]
  Standard Widget Toolkit for GTK+ JNI library

libswt-webkit-gtk-4-jni/stable,now 4.13.0-1+b2 armhf [installed]
  Standard Widget Toolkit for GTK+ WebKit JNI library

libswtcalendar-java/stable,now 0.5-3 all [installed]
  GUI date picker for Java using SWT

libswtchart-java/stable,now 0.10.0-4 all [installed]
  Chart drawing SWT component

libswtchart-java-doc/stable,now 0.10.0-4 all [installed]
  Chart drawing SWT component (documentation)
cycool29 commented 2 years ago

List of installed packages with *swt* regex:

libeclipse-e4-ui-css-swt-java
libeclipse-e4-ui-css-swt-theme-java
libeclipse-e4-ui-swt-gtk-java
libswt-cairo-gtk-4-jni
libswt-glx-gtk-4-jni
libswt-gtk-4-java
libswt-gtk-4-jni
libswt-webkit-gtk-4-jni
libswtcalendar-java
libswtchart-java
libswtchart-java-doc
angryziber commented 2 years ago

There are two possibilities:

  1. You have downloaded 64-bit ipscan with bundled SWT and not the "all" architecture option. Please check.
  2. Raspbian accidentally provided a 64-bit binaries of SWT with some updates

The error message of SWT loader clearly states that 64-bit SWT libraries are being loaded on a 32-bit Java.

cycool29 commented 2 years ago

I installed the buster DEB packages of libswt-cairo-gtk-4-jni, libswt-gtk-4-java and libswt-gtk-4-jni from packages.debian.org, and it worked!

image

angryziber commented 2 years ago

@cycool29 from here https://packages.debian.org/stable/libs/libswt-gtk-4-jni it seems that the package is available only for arm64, and not for 32-bit ARM.

Was the support for it removed? Maybe another solution would be to update to 64-bit Java?

cycool29 commented 2 years ago

@theofficialgman made deep research on this: https://github.com/Botspot/pi-apps/issues/1045#issuecomment-1014849090

I will open a ticket on https://bugs.launchpad.net/raspbian later.