Notarizing exported application on macOS 10.15 (Catalina)

I am trying to notarize an exported application on macOS 10.15 (Catalina) as it is required. My steps are as follows.

  1. Export application without embedding Java. “JDK 14 is the first release that complies with the new macOS 10.15 hardening and notarization requirements.”, yet “…Processing supports Java 1.8.”
  2. Execute the following in Terminal
cd my.app/Contents/Java
unzip jogl-all-natives-macosx-universal.jar -d jogl-all-natives-macosx-universal
unzip gluegen-rt-natives-macosx-universal.jar -d gluegen-rt-natives-macosx-universal
codesign --timestamp --options=runtime -s "my identity" -v gluegen-rt-natives-macosx-universal/natives/macosx-universal/libgluegen-rt.jnilib
codesign --timestamp --options=runtime -s "my identity" -v jogl-all-natives-macosx-universal/natives/macosx-universal/lib*
rm gluegen-rt-natives-macosx-universal.jar
rm jogl-all-natives-macosx-universal.jar
jar cvfM gluegen-rt-natives-macosx-universal.jar -C gluegen-rt-natives-macosx-universal .
jar cvfM jogl-all-natives-macosx-universal.jar -C jogl-all-natives-macosx-universal .
rm -r gluegen-rt-natives-macosx-universal/
rm -r jogl-all-natives-macosx-universal/
cd ../../..
codesign --timestamp --options=runtime -s "my identity" -v my.app
ditto -c -k --keepParent my.app my.zip
xcrun altool --notarize-app --primary-bundle-id my.app.id --username my.username --password my-password --file my.zip

I receive an email from Apple saying my software has been notarized. However when I run my application I receive a window with the message “Unable to load Java Runtime Environment.” I understand that the developers “…strongly recommended that you embed Java with your application.”, but I am unable to notarize an exported application with Java embedded. Is there a way to notarize an exported application on Catalina?

Try using a recent OpenJDK 8 from eg. AdoptOpenJDK - see info on notarization at https://blog.adoptopenjdk.net/2020/04/adoptopenjdk-8u252-1107-and-1401-available/