Search code examples
swtpentahoapple-m1pentaho-spoonpentaho-data-integration

Is there a solution around Pentaho 9.3 Spoon errors related to Apple Silicon M1 ARM?


Installed Pentaho Data Integration 9.3 on Mac OS Monterey on a MacBook Pro M1 (Apple Silicon.)

I am running OpenJDK 11:

Openjdk version "11.0.15" 2022-04-19

OpenJDK Runtime Environment (build 11.0.15+10)

OpenJDK 64-Bit Server VM (build 11.0.15+10, mixed mode)

The install.sh process runs without error. However, after install, trying to execute the spoon.sh process, the following errors occur...

WARNING: Using java from path
DEBUG: _PENTAHO_JAVA_HOME=
DEBUG: _PENTAHO_JAVA=java
DEBUG: PENTAHO_INSTALLED_LICENSE_PATH=
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-cocoa-3738 in java.library.path: [./../libswt/osx64/]
    no swt-cocoa in java.library.path: [./../libswt/osx64/]
    Can't load library: /Users/jgregory/.swt/lib/macosx/aarch64/libswt-cocoa-3738.jnilib
    Can't load library: /Users/jgregory/.swt/lib/macosx/aarch64/libswt-cocoa.jnilib
    Can't load library: /Users/jgregory/.swt/lib/macosx/aarch64/libswt-cocoa-3738.jnilib

    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
    at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
    at org.pentaho.di.ui.core.widget.OsHelper.setAppName(OsHelper.java:106)
    at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:652)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)

Has anyone run into this issue and are there any known workarounds?


Solution

  • Download latest swt for arm64 support from here

    https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/S-4.25M1-202207061800/swt-4.25M1-cocoa-macosx-aarch64.zip&mirror_id=518

    unzip it, get swt.jar and Put it under /path_to_your_data-integration/libswt/osx64/ and delete the one thats there.

    Than using rosseta shell, guide how to set up rosseta can be found here: https://stackoverflow.com/a/68571463/19586128

    start the spoon.sh with required configurations

    If you use java 8 It will complain first with: Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/swt/widgets/Control has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

    I update my JAVA_HOME to 18 (17 works too) and it worked

    This worked for me, but please feel free to ask if it does not work and i can help more with this