← Back to issue list

Jlink support for Java plugin

View original Github issue

Metadata

Project
craft-parts
Number
#891
Type
issue
State
closed
Author
vpa1977
Labels
Created
Updated
Closed

Current evaluation

Closed. The Java plugin proposal was superseded by a dedicated jlink plugin. It will generate lean runtimes across multiple parts. Extensions and build attributes were rejected due to parameter and multi-part processing limits.

Suggested action:

No scores available.

Issue body

### What needs to get done Java plugin should set JAVA_HOME https://github.com/canonical/craft-parts/issues/891 and provide a way to generate runtime for the Java application. This can be done by running `jlink` and passing a list of jar files. Java plugin by default copies files to `$CRAFT_PART_INSTALL/jars` and java plugin will pick up jars from this location in post build commands and generate the runtime for those jars. User should be able to specify the version of the Java to use and list of jar files and directories if the default value is not acceptable. User should be able to specify if he wants to run a jlink step. Java should be available as a plugin so that build without applying derivative plugins is supported. - register Java as a plugin. ``` parts: foo: plugin: java jlink: true jlink_java_version: 21 jlink_jars: - $CRAFT_PART_INSTALL/jar/jar1.jar - $CRAFT_PART_BUILD/jar/jar2.jar ``` - The plugin should install chisel slices into a build root (otherwise it affects build JDK) - The plugin should use chiselled runtime to generate jlink runtime. ### Why it needs to get done To have a lean runtime for java applications

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Closed. The Java plugin proposal was superseded by a dedicated jlink plugin. It will generate lean runtimes across multiple parts. Extensions and build attributes were rejected due to parameter and multi-part processing limits.
qwen/qwen3.6-35b-a3b Closed. The team rejected the proposed Java wrapper plugin and agreed to implement a separate, general jlink plugin instead. This new plugin will generate lean runtimes for multiple parts using its own properties and existing after behavior.
qwen/qwen3.6-35b-a3b Superseded by a design decision to implement a dedicated jlink plugin instead. The team agreed a standalone jlink plugin best generates lean runtimes for multiple parts, as extensions and build attributes cannot support the required multi-part parameters.
qwen3.6-35b-a3b-mtp-q6 The Java plugin jlink proposal was superseded. The team decided to implement a standalone jlink plugin instead, enabling lean runtime generation across multiple parts without modifying the existing Java plugin.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#688 feat: JLink plugin rockcraft closed Closed without merging. Maintainers decided to integrate JLink functionality as an option within the base Java plugin instead of maintaining a separate plugin. The standalone feature was abandoned in favor of this unified approach.
77%
#824 Please support plugin to generate java runtime for Java application craft-parts closed Feature request for a jdeps/jlink-based Java runtime plugin was closed by the author and superseded by craft-parts#891. Implementation remains pending in the referenced issue.
74%
#689 doc: jlink plugin description rockcraft closed Closed by author after a CI port conflict. Documentation for the jlink plugin was abandoned as the functionality will be implemented in the base java plugin instead.
73%