There is no real way to automate setting instance configuration settings that I am aware of without maybe some 3rd party tools, however, you could use this query, capture the results, then make the configuration changes on the new instance once installed to match manually via SSMS or T-Sql using those same settings.
Select * from sys.configurations order by ...
Turns out it's a bug in sql server 2016 and java applications:
Trace flag has to be turned on to enable the fix (3924)
Also there's a bug with that fix so make sure sql server is updated to the latest CU