Skip to content

jlink not working with Java 24/25 without *.jmod files. #1147

@dansiviter

Description

@dansiviter

Eclipse Temurin 24/25 JDK images do not contain jmod files (see here) due to JEP 493. Therefore, image generation fails with:

[ERROR] Failed to execute goal io.helidon.build-tools:helidon-maven-plugin:4.0.23:jlink-image (jlink-image) on project nucleus-api: Image generation error: The required *.jmod files (e.g. jmods/java.base.jmod) are missing in this JDK: /opt/java/openjdk -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.helidon.build-tools:helidon-maven-plugin:4.0.23:jlink-image (jlink-image) on project nucleus-api: Image generation error
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    ...at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
Caused by: org.apache.maven.plugin.MojoExecutionException: Image generation error
    at io.helidon.build.maven.JLinkImageMojo.execute (JLinkImageMojo.java:152)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    ...
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
Caused by: java.lang.IllegalArgumentException: The required *.jmod files (e.g. jmods/java.base.jmod) are missing in this JDK: /opt/java/openjdk
    at io.helidon.build.linker.util.JavaRuntime.assertJdk (JavaRuntime.java:157)
    at io.helidon.build.linker.util.JavaRuntime.current (JavaRuntime.java:182)
    at io.helidon.build.linker.Configuration$Builder.build (Configuration.java:508)
    at io.helidon.build.maven.JLinkImageMojo.execute (JLinkImageMojo.java:149)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)

For workaround is detailed in blog link above but downloading jmod files into the JDK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions