ClosestStorm / openjdk-osx-build

Automatically exported from code.google.com/p/openjdk-osx-build
0 stars 0 forks source link

JRE broken after sandboxing JRE on Mac because of libFontmanager.dylib #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. sign app and embedded JRE with codesign utility from Apple and sandbox xml
2. start app

What is the expected output? What do you see instead?
app doesn't start. exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
MyApp/Contents/PlugIns/1.7.0u6.jre/Contents/Home/lib/libfontmanager.dylib: 
dlopen(MyApp.app/Contents/PlugIns/1.7.0u6.jre/Contents/Home/lib/libfontmanager.d
ylib, 1): Library not loaded: /usr/X11/lib/libfreetype.6.dylib
  Referenced from: ...My.app/Contents/PlugIns/1.7.0u6.jre/Contents/Home/lib/libfontmanager.dylib
  Reason: no suitable image found.  Did find:
    /usr/X11/lib/libfreetype.6.dylib: open() failed with errno=1
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
    at java.lang.Runtime.loadLibrary0(Runtime.java:845)
    at java.lang.System.loadLibrary(System.java:1084)
    at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:84)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.lwawt.macosx.LWCToolkit.<clinit>(LWCToolkit.java:81)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:186)
    at java.awt.Toolkit$2.run(Toolkit.java:870)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:862)
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1732)
    at java.awt.EventQueue.invokeLater(EventQueue.java:1188)
    at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1287)
    at com.ultramixer.everdump.Start.main(Unknown Source)
logout

[Prozess beendet]

What version of the product are you using? On what operating system?
OpenJDK-OSX-1.7-universal-u-jre-jdk7u6-b14-20120619.dmg
Mac OS X 10.8 DP4

Please provide any additional information below.

Original issue reported on code.google.com by i...@ultramixer.com on 22 Jun 2012 at 11:17

GoogleCodeExporter commented 8 years ago
I didn't have Mountain Lion so couldn't help on this for now.

Original comment by henri.gomez on 27 Jun 2012 at 7:08

GoogleCodeExporter commented 8 years ago
I suppose this issue occurs on Lion too. the problem is the symlink outside of 
the app what is not allowed in a sandboxed java app on Mac OS X 10.7 or higher.

Original comment by i...@ultramixer.com on 27 Jun 2012 at 7:19

GoogleCodeExporter commented 8 years ago
Change should be done at OpenJDK 7/8 level, I can't help here

Original comment by henri.gomez on 2 Jul 2012 at 8:36

GoogleCodeExporter commented 8 years ago
Since changes are required at OpenJDK trunk level, I can't do it on 
openjdk-osx-build unless OpenJDK clearly mention it won't fix it

Original comment by henri.gomez on 2 Jul 2012 at 8:38

GoogleCodeExporter commented 8 years ago
Hey, I'm getting the exact same error with my app - without sandboxing, it runs 
fine, but as soon as I turn on sandboxing the app crashes with the same error 
message. I'm running Mountain Lion too, if that makes any difference. Have you 
found a fix yet? Apparently OpenJDK doesn't allow sandboxing yet - if this is 
true, I guess we'll have to wait till it does.

Original comment by mukund.t...@gmail.com on 4 Jul 2012 at 9:32

GoogleCodeExporter commented 8 years ago
But when I'm using oracles JRE version the error doesn't occurs... so it should 
be a problem of OpenJDK-OSX-build.

Original comment by i...@ultramixer.com on 4 Jul 2012 at 10:02

GoogleCodeExporter commented 8 years ago
quick fix: replace libfontmanager.dylib with Oracles version...

Original comment by i...@ultramixer.com on 4 Jul 2012 at 10:03

GoogleCodeExporter commented 8 years ago
Sorry, where do you get Oracle's version from? I can't seem to find it anywhere 

Original comment by mukund.t...@gmail.com on 4 Jul 2012 at 11:08

GoogleCodeExporter commented 8 years ago
http://jdk7.java.net/download.html

Original comment by i...@ultramixer.com on 4 Jul 2012 at 11:13

GoogleCodeExporter commented 8 years ago
Thanks very much! It works now, and I've just just finished packaging it with 
OpenJDK. I will try to submit it to the AppStore now and see if it is accepted!

Original comment by mukund.t...@gmail.com on 4 Jul 2012 at 11:50