Netlify bundles Java 8 (source) by default in the build image. I have a build tool that requires Java 11+. Generally, it seems Netlify supports customizing included tooling version, however, I have not been able to find any resources on customizing the version of Java the CI uses. How have folks change the version of Java from 8 to 11+?
The big hammer that would (probably) work would be to install java 11 at build init every single time the build runs. This would greatly slow down build time though. Other ideas?
We’ve spoken about this as a team and one option you could try is to include the binary of your desired JVM version and include that in your repo. From there, you could reference the path to that binary to ensure you’re getting the right version for your build tool to run, while eliminating the necessity to install it from scratch every time.
That said, the ability to specify a particular Java version is an excellent idea – if you file a feature request on our build image GitHub repo, we might be able to include this in future versions of our build image
Let us know if you have any other questions and we’d be happy to help!
Thanks for the suggestion @amelia. It sounds like it could work. We would like to avoid that solution for now since it will bloat our repo size until the end of time
I did go ahead and open a feature request issue on this one: Customizable Java version · Issue #788 · netlify/build-image · GitHub. Feel free to add anything you feel is missing