That will work, but it will still display the first time after installing Java. Until Java runs, and reads that file. You can call the Java control panel at the end of your script and close it. Which will cause Java to read that file.

That deployment.properties file populates those keys. It just takes Java launching to read that file. Once it's there it will never prompt again. I just got done doing a Java deployment so it's still fresh in my mind. It was a combination of different forum posts. I do not remember the specific one at the moment.

I'm using a combination of the deployment.properties file, and this GPO.