I bundle java with my program installation (so the customer doesn’t have to have java installed). At the end of installation I run the gradle-wrapper to fetch dependencies, however it fails to run since there is no java on the path. I’ve tried to use the org.gradle.java.home setting in my gradle-wrapper.properties file but it seems that is only used for the build process and not running gradle itself.
Is there any way I can run gradle using the java I’ve bundled without altering environment variables?
The generated wrapper scripts use two techniques to find the ‘java’ command. First is to look for a specified ‘JAVA_HOME’ environment variable, second it looks to see if the ‘java’ executable can be found on the path. Essentially, both of these are environment settings. If your installer can’t modify these then an alternative would be to alter the wrapper scripts to simply default to your embedded Java distribution.
Ok, I’ll try to see my options for setting the environment variables with our installer. If not I guess I’ll alter the wrapper script (didn’t realize that was an option). Thanks!