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
I use a product called install4j to create the DMG files for my app. It code signs the app correctly within the DMG file, and can do so from OS's other than macOS.
Warning though: install4j is not free software, and is actually quite pricey.