Application plugin and bundled JRE

What is the best way to modify start script to use specific path to jre?

Possible options could be to export JAVA_HOME inside start script or exporrt JAVACMD
How can i configure gradle.build to get modified start script?