1. Make MSI
Before installation, also make sure the installer have enough privilege:
You can set this in the default Domain Policy or in the installer GPO:
Computer Configuration > Policies > Administrative Templates > Windows Components/Windows Installer > Always install with elevated privileges
download the JRE file, then double click it, then go to your user folder, C:\Users\username\AppData\LocalLow\Oracle\Java\jrex.x.x_x64
Replace the username and x.x.x with your username and java version number, you will find the msi file here.Copy it to a shared location.
2. Deploy via GPO
same as this step:
http://frankfu.click/microsoft/group-policy/deploy-adobe-reader-dc.html,
3. Deploy with script
Java offers rich options for the package installation, which you can find here:
https://docs.oracle.com/javase/8/docs/technotes/guides/install/config.html#table_config_file_options
https://docs.oracle.com/javase/8/docs/technotes/guides/install/config.html#installing_with_config_file
INSTALLDIR=
Default/path_of_yourchoice
REMOVEOUTOFDATEJRES=1
will remove all JREs below the security baseline. JREs above the security baseline will not be uninstalled.
jre-xxxx.exe /s REMOVEOUTOFDATEJRES=1 INSTALL_SILENT=Enable INSTALLDIR=C:\java\jre WEB_JAVA_SECURITY_LEVEL=VH
References: