Some time ago I wrote a post on how to brew and manage multiple (Adopt)OpenJDK versions on your mac - which is my current java setup. Premised so, lately I wanted to install STM32CubeMX on my (freshly formatted) laptop and I incurred in this friendly error:

Andreas-MacBook-Pro:~ a.leofreddi$ ~/Downloads/en.STM32CubeMX_v5-0-1/
chdir /Users/a.leofreddi/Downloads/en.STM32CubeMX_v5-0-1/
current dir /Users/a.leofreddi/Downloads/en.STM32CubeMX_v5-0-1/
Jul 11, 2019 11:21:46 AM INFO: Logging initialized at level 'INFO'
Jul 11, 2019 11:21:46 AM INFO: Commandline arguments:
Jul 11, 2019 11:21:47 AM INFO: Detected platform: mac_osx,version=10.14.5,arch=x86,symbolicName=null,javaVersion=9
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/adoptopenjdk-9.jdk/Contents/Home/lib/libfontmanager.dylib: dlopen(/Library/Java/JavaVirtualMachines/adoptopenjdk-9.jdk/Contents/Home/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
  Referenced from: /Library/Java/JavaVirtualMachines/adoptopenjdk-9.jdk/Contents/Home/lib/libfontmanager.dylib
  Reason: image not found
	at java.base/java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.base/java.lang.ClassLoader.loadLibrary0(
	at java.base/java.lang.ClassLoader.loadLibrary(
	at java.base/java.lang.Runtime.loadLibrary0(
	at java.base/java.lang.System.loadLibrary(
	at java.desktop/sun.lwawt.macosx.LWCToolkit$
	at java.desktop/sun.lwawt.macosx.LWCToolkit$
	at java.base/ Method)

Beautiful, isn't it? At first I've tried to switch to Java 8, and everything went fine. But I was really curious about why it fails with Java 9, so I digged a bit. From the error, it clearly looks like @rpath/libfreetype.6.dylib is not found. So I went to give a look in /Library/Java/JavaVirtualMachines/adoptopenjdk-9.jdk/Contents/Home/lib and... what?? libfreetype.dylib.6 is there, but not libfreetype.6.dylib! Symlinking libfreetype.dylib.6 to libfreetype.6.dylib did the trick :)