For OS X, I distribute my Java application inside a DMG. Since Mountain Lion\'s release, opening the app gives the following error message:
[app name] is
You could workaround this by only signing the JavaApplicationStub and info.plist of your application and exclude the "Resources" folder from signing. Then you'd have to change your build process to use the pre-signed container. Of course this is not the sense of codesigning but it will work ;-)
To achieve this, do the following steps:
ResourceRules.plist:
rules
^Resources/
^version.plist$
now sign with the following commands: CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate" codesign -s "Certificate Name" --resource-rules ResourceRules.plist -fv MyApp.app
Then delete everything in Resource and verify the signature (codesign -v -v MyApp.app). You will see that it's still valid
Use the complete signed stub in your build process. You can change everything in Resources but you cannot change info.plist.