GoogleContainerTools/jib · error · MojoExecutionException
<message from IncompatibleBaseImageJavaVersionException via
Error message
<message from IncompatibleBaseImageJavaVersionException via HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven>
What it means
Thrown as a MojoExecutionException from BuildTarMojo.execute when the project's Java major version is incompatible with the base image's Java version (IncompatibleBaseImageJavaVersionException). The message is produced by HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven and suggests a matching base image for your project's Java version.
Source
Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java:143
+ "DateTimeFormatter.ISO_DATE_TIME) or special keyword \"EPOCH_PLUS_SECOND\": "
+ ex.getInvalidFilesModificationTime(),
ex);
} catch (InvalidCreationTimeException ex) {
throw new MojoExecutionException(
"<container><creationTime> should be an ISO 8601 date-time (see "
+ "DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\"EPOCH\", "
+ "\"USE_CURRENT_TIMESTAMP\"): "
+ ex.getInvalidCreationTime(),
ex);
} catch (JibPluginExtensionException ex) {
String extensionName = ex.getExtensionClass().getName();
throw new MojoExecutionException(
"error running extension '" + extensionName + "': " + ex.getMessage(), ex);
} catch (IncompatibleBaseImageJavaVersionException ex) {
throw new MojoExecutionException(
HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven(
ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),
ex);
} catch (InvalidImageReferenceException ex) {
throw new MojoExecutionException(
HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);
} catch (IOException
| CacheDirectoryCreationException
| MainClassInferenceException
| InvalidGlobalConfigException ex) {
throw new MojoExecutionException(ex.getMessage(), ex);
} catch (BuildStepsExecutionException ex) {
throw new MojoExecutionException(ex.getMessage(), ex.getCause());
} catch (ExtraDirectoryNotFoundException ex) {View on GitHub (pinned to fb949e2676)
Solutions
- Update <from><image> to a base image matching or exceeding your project's Java version (the error text names the required version).
- For Jib-provided images, switch to the variant for your major version, e.g. gcr.io/jib-runtime-image:21 or eclipse-temurin:21-jre.
- Alternatively lower the project's Java version (maven.compiler.source/target or release flag) if it must match an older base image.
- Check for a parent POM or profile pinning an old base image and update it there.
Example fix
// before <from><image>gcr.io/jib-runtime-image:11</image></from> // after <from><image>gcr.io/jib-runtime-image:21</image></from>
Defensive patterns
Strategy: validation
Validate before calling
// Verify project vs base image Java versions before building
String target = project.getProperties().getProperty("maven.compiler.target");
String baseImageJava = "17"; // major version of the chosen base image
if (Integer.parseInt(target) > Integer.parseInt(baseImageJava)) {
throw new IllegalStateException("Base image Java " + baseImageJava + " < project target " + target);
} Prevention
- Update <from><image> whenever bumping maven.compiler.source/target/release.
- Prefer parameterized base image versions (property or profile) tied to the compiler target.
- Read the error's suggestion text — it names a compatible base image.
- Watch for parent POMs pinning an outdated base image.
When it happens
Trigger: Building with <from><image> set to a Jib-provided base image (e.g. gcr.io/jib-runtime-image or distroless java) whose major Java version (e.g. 17) is lower than the project's compile target (e.g. maven.compiler.target=21).
Common situations: After upgrading the project to a newer JDK (e.g. 11 -> 17 or 17 -> 21) without updating the base image; using the default jib-runtime-style image pinned to an older Java.
Related errors
- <message from IncompatibleBaseImageJavaVersionException via
- <message from IncompatibleBaseImageJavaVersionException via
- The input JAR (${jarPath}) is compiled with Java ${jarJavaVe
- Your project is using Java ${projectMajorJavaVersion} but th
- HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForGra
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/be57176fd864880e.
Report an issue: GitHub.