Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkError on GUI apps on MacOS #489

Closed
karianna opened this issue Sep 10, 2018 · 26 comments
Closed

LinkError on GUI apps on MacOS #489

karianna opened this issue Sep 10, 2018 · 26 comments
Assignees
Labels
bug Issues that are problems in the code as reported by the community
Milestone

Comments

@karianna
Copy link
Contributor

From @helenmasters on September 5, 2017 13:7

We are seeing an issue on OSX when we try to run any GUI applications. It looks as though /Users/jenkins/workspace is hardcoded so cannot be resolved on the user's machine.

Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/helenmasters/sdks/check/jdk8u144-b01/jre/lib/libfontmanager.dylib: dlopen(/Users/helenmasters/sdks/check/jdk8u144-b01/jre/lib/libfontmanager.dylib, 1): Library not loaded: /Users/jenkins/workspace/openjdk_build_x86-64_macos/openjdk/installedfreetype/lib/libfreetype.6.dylib
  Referenced from: /Users/helenmasters/sdks/check/jdk8u144-b01/jre/lib/libfontmanager.dylib
  Reason: image not found
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:93)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:80)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.lwawt.macosx.LWCToolkit.<clinit>(LWCToolkit.java:79)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at java.awt.Toolkit$2.run(Toolkit.java:860)
	at java.awt.Toolkit$2.run(Toolkit.java:855)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
	at javax.swing.UIManager.getSystemLookAndFeelClassName(UIManager.java:611)
	at javax.swing.UIManager$1.run(UIManager.java:1233)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.swing.UIManager.loadSwingProperties(UIManager.java:1228)
	at javax.swing.UIManager.initialize(UIManager.java:1457)
	at javax.swing.UIManager.maybeInitialize(UIManager.java:1426)
	at javax.swing.UIManager.getUI(UIManager.java:1006)
	at javax.swing.JPanel.updateUI(JPanel.java:126)
	at javax.swing.JPanel.<init>(JPanel.java:86)
	at javax.swing.JPanel.<init>(JPanel.java:109)
	at javax.swing.JPanel.<init>(JPanel.java:117)
	at citmsxa.<init>(citmsxa.java:11)
	at citmsxa.main(citmsxa.java:376)

Here is the output from the otool command suggesting that the path is incorrect...

helens-mbp:check helenmasters$ otool -L /Users/helenmasters/sdks/check/jdk8u144-b01/jre/lib/libfontmanager.dylib
/Users/helenmasters/sdks/check/jdk8u144-b01/jre/lib/libfontmanager.dylib:
	@rpath/libfontmanager.dylib (compatibility version 1.0.0, current version 1.0.0)
	/Users/jenkins/workspace/openjdk_build_x86-64_macos/openjdk/installedfreetype/lib/libfreetype.6.dylib (compatibility version 12.0.0, current version 12.0.0)
	@rpath/libawt.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
	@rpath/libjava.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/libjvm.dylib (compatibility version 1.0.0, current version 1.0.0)

Copied from original issue: AdoptOpenJDK/openjdk-jdk8u-backup#4

@karianna karianna added the bug Issues that are problems in the code as reported by the community label Sep 10, 2018
@karianna
Copy link
Contributor Author

From @Diagoras on September 6, 2018 16:53

FWIW, I'm having the same issue. It's currently blocking us from migrating an application to AdoptOpenJDK.

@karianna
Copy link
Contributor Author

@johnoliver LMK if you want this moved to the build repo as a bug

@karianna
Copy link
Contributor Author

From @johnoliver on September 7, 2018 12:15

I think this was fixed, can you try a recent binary from https://github.com/AdoptOpenJDK/openjdk8-binaries/releases

@karianna
Copy link
Contributor Author

From @Diagoras on September 10, 2018 19:36

@johnoliver Hey, I tried with the Hotspot jdk8u-2018-07-26-16-12 release for MacOS, but ran into the same issue. Specifically:

Fatal(java.lang.UnsatisfiedLinkError: /Users/[username]/Downloads/jdk8u181-b13/jre/lib/libfontmanager.dylib: dlopen(/Users/[username]/Downloads/jdk8u181-b13/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
  Referenced from: /Users/[username]/Downloads/jdk8u181-b13/jre/lib/libfontmanager.dylib
  Reason: image not found
)

Can we reopen this issue?

@karianna
Copy link
Contributor Author

Reopened, but I'll shift it to the build repo

@pdl3
Copy link

pdl3 commented Sep 28, 2018

Seeing a possibly related error on MacOS 10.13.6 using AdoptOpenJDK jdk8u172-b11
Setting up a symlink is a workaround for the issue:
ln -s libfreetype.dylib.6 libfreetype.6.dylib

Stacktrace
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/jdk8u172-b11/jre/lib/libfontmanager.dylib: dlopen(/Library/Java/JavaVirtualMachines/jdk8u172-b11/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib Referenced from: /Library/Java/JavaVirtualMachines/jdk8u172-b11/jre/lib/libfontmanager.dylib Reason: image not found at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:93)

@karianna karianna added this to the 2.x.x milestone Sep 29, 2018
@zman0900
Copy link

Problem still exists with the jdk8u181-b13 build:

java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/jdk8u181-b13/Contents/Home/jre/lib/libfontmanager.dylib: dlopen(/Library/Java/JavaVirtualMachines/jdk8u181-b13/Contents/Home/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
  Referenced from: /Library/Java/JavaVirtualMachines/jdk8u181-b13/Contents/Home/jre/lib/libfontmanager.dylib
  Reason: image not found

Actual lib name does not match rpath:

$ ls /Library/Java/JavaVirtualMachines/jdk8u181-b13/Contents/Home/jre/lib/libfreetype*
/Library/Java/JavaVirtualMachines/jdk8u181-b13/Contents/Home/jre/lib/libfreetype.dylib.6

@Alasiac
Copy link

Alasiac commented Oct 18, 2018

Just ran into this issue because we have a dependency on Apache POI, so we cannot migrate to adopt open jdk 8...

@karianna
Copy link
Contributor Author

Is there a short/simple reproducible I can try?

@Alasiac
Copy link

Alasiac commented Oct 19, 2018

Here a basic example of what triggers the exception:

poi-example.zip

The example does run on an Oracle jdk8.

Stack trace when running the test:

runningPoiResultsInLinkError(com.example.poi.link.PoiLinkTest) Time elapsed: 0.958 sec <<< ERROR!
java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/lib/libfontmanager.dylib: dlopen(/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
Referenced from: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/lib/libfontmanager.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:61)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerNativeLibrary.(FontManagerNativeLibrary.java:32)
at sun.font.SunFontManager$1.run(SunFontManager.java:339)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.(SunFontManager.java:335)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at java.awt.Font.getFont2D(Font.java:491)
at java.awt.Font.canDisplayUpTo(Font.java:2060)
at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
at java.awt.font.TextLayout.(TextLayout.java:531)
at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:208)
at org.apache.poi.xssf.streaming.SXSSFSheet.autoSizeColumn(SXSSFSheet.java:1166)
at org.apache.poi.xssf.streaming.SXSSFSheet.autoSizeColumn(SXSSFSheet.java:1148)
at com.example.poi.link.PoiLinkTest.runningPoiResultsInLinkError(PoiLinkTest.java:14)

@slandelle
Copy link

slandelle commented Nov 5, 2018

Same thing here, Swing doesn't work with u192-b12 (note: I ran into this when migrating from OracleJDK) :

Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib: dlopen(/Library/Java/JavaVirtualMachines/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
  Referenced from: /Library/Java/JavaVirtualMachines/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib
  Reason: image not found
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:93)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:80)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.lwawt.macosx.LWCToolkit.<clinit>(LWCToolkit.java:79)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at java.awt.Toolkit$2.run(Toolkit.java:860)
	at java.awt.Toolkit$2.run(Toolkit.java:855)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
	at java.awt.Window.getToolkit(Window.java:1358)
	at java.awt.Window.init(Window.java:506)
	at java.awt.Window.<init>(Window.java:436)
	at java.awt.Frame.<init>(Frame.java:446)
	at java.awt.Frame.<init>(Frame.java:404)
	at javax.swing.JFrame.<init>(JFrame.java:213)

zman0900 referenced this issue in macports/macports-ports Nov 12, 2018
@gabibau
Copy link

gabibau commented Dec 5, 2018

I have the same Issue. Even with code as simple as this (running with Netbeans):

public class JavaApplication4 {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println(" Hello !");

        JFrame frame = new JFrame("Testando");
        frame.setVisible(true);
        frame.setSize(300, 300);
    }
}
run:
 Hello !
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib: dlopen(/Library/Java/JavaVirtualMachines/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
  Referenced from: /Library/Java/JavaVirtualMachines/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib
  Reason: image not found
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:93)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:80)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.lwawt.macosx.LWCToolkit.<clinit>(LWCToolkit.java:79)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at java.awt.Toolkit$2.run(Toolkit.java:860)
	at java.awt.Toolkit$2.run(Toolkit.java:855)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
	at java.awt.Window.getToolkit(Window.java:1358)
	at java.awt.Window.init(Window.java:506)
	at java.awt.Window.<init>(Window.java:537)
	at java.awt.Frame.<init>(Frame.java:420)
	at javax.swing.JFrame.<init>(JFrame.java:233)
	at javaapplication4.JavaApplication4.main(JavaApplication4.java:23)
/Users/gabriela/Library/Caches/NetBeans/8.2/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 3 seconds)

I cannot migrate to AdoptOpenJDK because of this.

@slandelle
Copy link

The workaround is to create a symlink: libfreetype.6.dylib -> libfreetype.dylib.6

@Diagoras
Copy link

Diagoras commented Dec 6, 2018

@slandelle Is the root cause just that the filename has "6" and "dylib" in the wrong order? Because that's be pretty funny, and hopefully an easy fix.

@karianna
Copy link
Contributor Author

karianna commented Dec 7, 2018

It appears to be a subtle difference between versions of Mac OS X. Hope to have this resolved next week for future builds!

@gabibau
Copy link

gabibau commented Dec 10, 2018

The workaround is to create a symlink: libfreetype.6.dylib -> libfreetype.dylib.6

It Works here. I hope it helps to fix the issue soon.
Thanks!

@karianna karianna modified the milestones: 2.x.x, December 2018 Dec 10, 2018
@Cynthiahaha
Copy link

#1 cd to the jdk path lib "/Contents/Home/jre/lib"
#2 then "sudo ln -s libfreetype.dylib.6 libfreetype.6.dylib"
It worked for me.

@breun
Copy link

breun commented Dec 26, 2018

Trying to run Groovy's groovysh -- which is not a GUI tool -- on AdoptOpenJDK 8 also triggers this:

$ groovysh
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:110)
	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
Caused by: java.lang.UnsatisfiedLinkError: /Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/jre/lib/libfontmanager.dylib: dlopen(/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
  Referenced from: /Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/jre/lib/libfontmanager.dylib
  Reason: image not found
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:93)
	at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:80)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.lwawt.macosx.LWCToolkit.<clinit>(LWCToolkit.java:79)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at java.awt.Toolkit$2.run(Toolkit.java:860)
	at java.awt.Toolkit$2.run(Toolkit.java:855)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
	at java.awt.Desktop.isDesktopSupported(Desktop.java:169)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1859)
	at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3797)
	at org.codehaus.groovy.runtime.callsite.ClassMetaClassGetPropertySite.getProperty(ClassMetaClassGetPropertySite.java:50)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:298)
	at org.codehaus.groovy.tools.shell.commands.DocCommand.<clinit>(DocCommand.groovy:53)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:249)
	at org.codehaus.groovy.tools.shell.util.DefaultCommandsRegistrar.register(DefaultCommandsRegistrar.groovy:84)
	at org.codehaus.groovy.tools.shell.util.DefaultCommandsRegistrar$register.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
	at org.codehaus.groovy.tools.shell.Groovysh$_createDefaultRegistrar_closure3.doCall(Groovysh.groovy:121)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at org.codehaus.groovy.tools.shell.Groovysh.<init>(Groovysh.groovy:109)
	at org.codehaus.groovy.tools.shell.Groovysh.<init>(Groovysh.groovy:140)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:257)
	at org.codehaus.groovy.tools.shell.Main.<init>(Main.groovy:65)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:257)
	at org.codehaus.groovy.tools.shell.Main.main(Main.groovy:158)
	... 6 more

Creating the symlink as suggested by @Cynthiahaha helps.

This groovysh issue is not present when using an AdoptOpenJDK 11 build (HotSpot or OpenJ9).

@ryandesign
Copy link

Is the root cause just that the filename has "6" and "dylib" in the wrong order? Because that's be pretty funny, and hopefully an easy fix.

It appears to be a subtle difference between versions of Mac OS X

On non-macOS UNIX-like operating systems, the shared library suffix is "so" and it occurs before any version number (e.g. "libfreetype.so.6"). On macOS, the dynamic library suffix is "dylib" and it occurs after the optional major version number (e.g. "libfreetype.6.dylib"). All versions of macOS follow this convention. Probably there is somewhere in the build system where an assumption that the version number should appear after the suffix is incorrectly being applied when building on macOS.

@justinnichols
Copy link

#1 cd to the jdk path lib "/Contents/Home/jre/lib"
#2 then "sudo ln -s libfreetype.dylib.6 libfreetype.6.dylib"
It worked for me.

Thanks for this workaround. This affected creating PDFs as well (via a backend service), not just on a GUI app.

@karianna
Copy link
Contributor Author

@breun
Copy link

breun commented Jan 16, 2019

@karianna They seem to fix the issue I had with running groovysh.

I did notice these builds have both libfreetype.6.dylib and libfreetype.dylib.6 and they are not identical:

$ ls -l libfreetype.*
-rwxr-xr-x@ 1 breun  staff  873072 15 jan 18:38 libfreetype.6.dylib
-rwxr-xr-x@ 1 breun  staff  873088 15 jan 18:38 libfreetype.dylib.6

Is this necessary/intentional?

@karianna
Copy link
Contributor Author

@karianna They seem to fix the issue I had with running groovysh.

I did notice these builds have both libfreetype.6.dylib and libfreetype.dylib.6 and they are not identical:

$ ls -l libfreetype.*
-rwxr-xr-x@ 1 breun  staff  873072 15 jan 18:38 libfreetype.6.dylib
-rwxr-xr-x@ 1 breun  staff  873088 15 jan 18:38 libfreetype.dylib.6

Is this necessary/intentional?

@johnoliver Same question as other issue.

@johnoliver
Copy link
Contributor

think this is done

@gdams
Copy link
Member

gdams commented Jan 23, 2019

can it be closed @johnoliver

@johnoliver
Copy link
Contributor

I think so, can be reopened if someone has an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that are problems in the code as reported by the community
Projects
None yet
Development

No branches or pull requests