In case the user has built with Java 22 for example, and then try to use the latest Paketo Buildpacks (that recently removed 22), the error message can be hard to decipher:
[INFO] [creator] Using Java version 22 extracted from MANIFEST.MF
[INFO] [creator] No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO] [creator] : Contributing to layer
[INFO] [creator] Warning: Dependency has no SHA256. Skipping cache.
[INFO] [creator] Downloading from
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to get dependency . see DEBUG log level
[INFO] [creator] ERROR: failed to build: exit status 1
if !jreSkipped && jreMissing {
// we wanted a JRE, but it's missing
subMsg := "No JRE matching the desired Java version is provided by the buildpack, try changing the Java version required"
msg = fmt.Sprintf("%s. %s", subMsg, msg)
}
Describe the Enhancement
In case the user has built with Java 22 for example, and then try to use the latest Paketo Buildpacks (that recently removed 22), the error message can be hard to decipher:
This is due to the fact we don't display specific error messages for this case https://github.com/paketo-buildpacks/libjvm/blob/main/build.go#L317-L335
Possible Solution
Motivation
Make the error message clearer