openhab / openhab-distro

The binary distribution of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.3k stars 393 forks source link

Java Service Wrapper x86 libraries get installed on MacOS X arm64 #1535

Open kgoderis opened 1 year ago

kgoderis commented 1 year ago

When doing an out of the box installation on an Apple arm64 based system, it seems that openhab> install-service goes wrong. In addition to https://github.com/openhab/openhab-distro/issues/238 and https://github.com/openhab/openhab-distro/issues/401 it seems that the libwrapper.jnilib in %KARAF_HOME%/lib/wrapper/ is in fact a x86 library.

kgoderis@Mac-Mini wrapper % sudo /opt/openhab/runtime/bin/openHAB-service console Running openHAB runtime... wrapper | --> Wrapper Started as Console wrapper | Launching a JVM... jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. jvm 1 | jvm 1 | jvm 1 | WARNING - Unable to load the Wrapper's native library 'libwrapper.dylib'. jvm 1 | The file is located on the path at the following location but jvm 1 | could not be loaded: jvm 1 | /opt/openhab/runtime/lib/wrapper/libwrapper.dylib jvm 1 | Please verify that the file is readable by the current user jvm 1 | and that the file has not been corrupted in any way. jvm 1 | One common cause of this problem is running a 32-bit version jvm 1 | of the Wrapper with a 64-bit version of Java, or vica versa. jvm 1 | This is a 64-bit JVM. jvm 1 | Reported cause: jvm 1 | /opt/openhab/runtime/lib/wrapper/libwrapper.dylib: dlopen(/opt/openhab/runtime/lib/wrapper/libwrapper.dylib, 0x0001): tried: '/opt/openhab/runtime/lib/wrapper/libwrapper.dylib' (fat file, but missing compatible architecture (have 'unknown,i386,x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/openhab/runtime/lib/wrapper/libwrapper.dylib' (no such file), '/opt/openhab/runtime/lib/wrapper/libwrapper.dylib' (fat file, but missing compatible architecture (have 'unknown,i386,x86_64', need 'arm64')) jvm 1 | System signals will not be handled correctly.

This can be solved by installing https://download.tanukisoftware.com/wrapper/3.5.53/wrapper-macosx-arm-64-3.5.53.pkg and then doing

sudo cp /usr/local/Cellar/wrapper/3.5.53/lib/libwrapper.dylib /opt/openhab/runtime/lib/wrapper

which yields

kgoderis@Mac-Mini wrapper % sudo /opt/openhab/runtime/bin/openHAB-service console Running openHAB runtime... wrapper | --> Wrapper Started as Console wrapper | Launching a JVM... jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. jvm 1 | jvm 1 | WARNING - The Wrapper jar file currently in use is version "3.2.3" jvm 1 | while the version of the native library is "3.5.53". jvm 1 | The Wrapper may appear to work correctly but some features may jvm 1 | not function correctly. This configuration has not been tested jvm 1 | and is not supported. jvm 1 |

It therefore seems that the openHAB distro needs an upgrade of Java Wrapper, as 3.2.3 is very ancient and does not support the newer arm64 architecture

wborn commented 1 year ago

The wrapper is a Karaf dependency and it seems like it cannot be updated due to licensing issues.

See: KARAF-2734, KARAF-5853

Version 3.2.3 is also the most recent version on Maven Central:

https://central.sonatype.com/artifact/tanukisoft/wrapper/3.2.3/versions