java – Unable to open data-integration app in mac – Code Utility

[

When I open data-integration from my macOS Catalina using my Terminal I get this error

I type this command ./spoon.sh . What could be be missing ?

  - General - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : java.lang.NullPointerException
  - General -   at org.eclipse.swt.widgets.Control.internal_new_GC(Unknown Source)
  - General -   at org.eclipse.swt.graphics.GC.<init>(Unknown Source)
  - General -   at org.eclipse.swt.graphics.GC.<init>(Unknown Source)
  - General -   at org.eclipse.swt.custom.CLabel.getTotalSize(Unknown Source)
  - General -   at org.eclipse.swt.custom.CLabel.onPaint(Unknown Source)
  - General -   at org.eclipse.swt.custom.CLabel$1.paintControl(Unknown Source)
  - General -   at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
  - General -   at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Control.drawWidget(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Canvas.drawWidget(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Widget.drawRect(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Canvas.drawRect(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
  - General -   at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
  - General -   at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Display.applicationProc(Unknown Source)
  - General -   at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
  - General -   at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(Unknown Source)
  - General -   at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
  - General -   at org.pentaho.di.ui.spoon.dialog.TipsDialog.open(TipsDialog.java:171)
  - General -   at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:7900)
  - General -   at org.pentaho.di.ui.spoon.Spoon.createContents(Spoon.java:9186)
  - General -   at org.eclipse.jface.window.Window.create(Window.java:426)
  - General -   at org.eclipse.jface.window.Window.open(Window.java:785)
  - General -   at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9201)
  - General -   at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:648)
  - General -   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  - General -   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  - General -   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  - General -   at java.lang.reflect.Method.invoke(Method.java:498)
  - General -   at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)

,

head over to
https://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64
and download the latest jar for macOS.

You’ll have to put this in /libswt/osx64.
You don’t have to change the filename, but you have to delete the original swt.jar!

,

Downloading the latest version of swt.jar and replacing it in libswt/osx64 worked for me.

,

I was facing the same issue in my Mac running on BigSur. The version I am currently using is Pentaho 9.1.0.0-324, installed via brew install --cask data-integration. However on clicking the Data Integration icon from Applications folder, nothing was showing up. Hence, below is what I did.

From Applications folder right click on Data Integration icon
Show package contents > MacOS

Edited the JavaApplicationStub by hard-coding BASE_DIR with the path of the parent directory within which the spoon.sh file resides.

#!/bin/sh

# PROG_DIR=$(cd "$(dirname "$0")"; pwd)

# # PROG_DIR is in .app/Contents/MacOS

# BASE_DIR="$PROG_DIR"/../../../ 

BASE_DIR=/Volumes/Macintosh/usr/local/Caskroom/data-integration/9.1.0.0-324/data-integration
cd "$BASE_DIR"

. "spoon.command" "$BASE_DIR" 

Now double click Data Integration from Applications, should open.
Won’t consider fiddling with default installation files this way, but hey works for me and hope this works for others as well 🙂

,

I found Sarit Kumar’s suggestion to edit JavaApplicationStub and Lechat’s solution to the actual question essential (kudos to both), but Launcher still did not work because my default Java was not compatible.

Also, when editing “JavaApplicationStub”, I used “/usr/local” instead of referring to “/Volumes” to avoid the problem with the space in “/Volumes/Macintosh HD”.

Below are all the steps.

  1. Install data-integration via brew.
$ brew install data-integration
  1. Edit file “/Applications/Data\ Integration.app/Contents/MacOS/JavaApplicationStub” and add 2 lines that replace the BASE_DIR with the absolute path to data-integration installed by brew, and export PENTAHO_JAVA_HOME to point to the absolute path of your java 8 installation.
#BASE_DIR="$PROG_DIR"/../../../ 
BASE_DIR=/usr/local/Caskroom/data-integration/9.1.0.0-324/data-integration
cd "$BASE_DIR"
export PENTAHO_JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home

. "spoon.command" "$BASE_DIR"

Here is a link to an article by Kevin Hooke managing multiple JDKs in Mac’s /Library/Java/JavaVirtualMachines directory, and a link to Azul Zulu builds of OpenJDK (move down the page).

  1. Replace the /usr/local/Caskroom/data-integration/9.1.0.0-324/data-integration/libswt/osx64/swt.jar with the one from Maven Repository. Be sure to use the base jar (e.g. 3.116.0) and not the patch (e.g. 3.116.100). You must add the patch yourself the base jar (not done here or addressed in this post) if you want to use the patch. On the Maven page, click on the version number, then click on the “jar” in the Files tab to get the download started. I renamed the old jar, and used a sim link to the replacement.
$ ls -l
total 7704
[email protected] 1 kfreidank  admin    17374 Jul 22 16:22 org.eclipse.swt-3.116.100.jar
[email protected] 1 kfreidank  admin  2159710 Jul 22 16:30 org.eclipse.swt.cocoa.macosx.x86_64-3.116.0.jar
lrwxr-xr-x  1 kfreidank  admin       47 Jul 22 16:30 swt.jar -> org.eclipse.swt.cocoa.macosx.x86_64-3.116.0.jar
[email protected] 1 kfreidank  admin  1757257 Sep  7  2020 swt.jar.orig
  1. You should be able to use the Data Integration icon from the Launchpad.
  2. You can also use the command line by using the full path to
$ /Applications/Data\ Integration.app/Contents/MacOS/JavaApplicationStub

,

Same error on Version 8.1.

Solution: install JDK 1.8.0_202, works well 🙂

]