GoogleCloudPlatform/buildpacks

Java version defaults to version 11

mstahv opened this issue · 4 comments

"Nobody" uses that old Java these days, I'd expect there to be 21. Tryid to deploy my test throug Cloud Shell and it only allowed to choose between 17 & 21.

Ah, yeah linking this back to #254

Java 11 is hardcoded, which I really want to bump but that'd be a breaking change to most people. Our next opportunity is with google-24 builder coming later this year when we publish the Ubuntu 24 based builders. We really should just unpin the java buildpack and respect the language-idiomatic declarations

I don't think we need to wait for google-24 to make this change. All other runtimes default to the latest available version and parse framework configs / env vars for overrides. IIRC the reason we didn't do this for Java was because we were pulling the JDK from a public repo that didn't have a version index, but that is no longer an issue now that we are hosting our own JDK tarballs.

This is making it hard to test gen 2 Cloud Functions, which only support Java 17 and 21.

Is there a workaround for this? I thought setting GOOGLE_RUNTIME_VERSION to 17 would fix my issue as per the note in 254, but I've been unsuccessful.

Currently following these docs here when I ran into the issue: https://cloud.google.com/functions/docs/running/functions-emulator