I kept seeing the following pop-up during Java based builds on Mac OS X:
There was no obvious cause, but this was annoying as it paused the build until I dismissed the pop-up, although it never seemed to have any side-effect in the build.
I finally seem to have found the solution, which was to delete the Java related files in the directory ~/Library/Saved Application State:
$ rm -rf ~/Library/Saved\ Application\ State/com.apple.javajdk16.cmd.savedState/
$ rm -rf ~/Library/Saved\ Application\ State/net.java.openjdk.cmd.savedState/