Signing bundled JRE

Marco Dinacci marco.dinacci at gmail.com
Tue Aug 21 16:00:10 PDT 2012


Hi Steve,

> I just tried submitting my Java app to the app store last night and
> received an error message saying that my nested app bundle Java SE 7 is not
> signed.  If, however, I sign the nested bundle, my app will no longer open.
>  I get a Console log message saying that the application exited with Code:
> 2.

I encountered this problem too, I forgot to add it to my guide....
If you sign all the files in the bundle it won't work as codesign
doesn't follow the symlinks.

First sign your bundle:
codesign --verbose -f -s "$SIGNATURE_APP" --entitlements $ENTITLEMENTS
$YOUR_APP.app

Then sign all the libraries:
find $YOUR_APP/Contents/ -type f \( -name "*.jar" -or -name "*.dylib"
\) -exec codesign --verbose -f -s "$SIGNATURE_APP" --entitlements
$ENTITLEMENTS {} \;

Finally you can create the package:
productbuild --component YOUR_APP.app /Applications --sign
"$SIGNATURE_INST" YOUR_APP.pkg

You can test if the package work with this command:

sudo installer -store -pkg $YOUR_APP.pkg -target /

You can also verify all libraries have been signed
find YOUR_APP/Contents/ -type f \( -name "*.jar" -or -name "*.dylib"
\) -exec codesign --verbose --verify {} \;


Best,
Marco


More information about the macosx-port-dev mailing list