GoogleCloudPlatform / buildpacks

Builders and buildpacks designed to run on Google Cloud's container platforms
Apache License 2.0
974 stars 144 forks source link

Java version defaults to version 11 #385

Open mstahv opened 7 months ago

mstahv commented 7 months ago

"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.

jama22 commented 7 months ago

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

matthewrobertson commented 7 months ago

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.

tireiron commented 5 months ago

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

gdaramol commented 4 months ago

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