Stéphane Mottelet
Stéphane Mottelet

Reputation: 3014

Duplicate resource error when using jlink with jdeps info (Java 17)

I use jlink feeded with jdeps info to package a minimal jre for my application. The command

jdeps --ignore-missing-deps --print-module-deps --recursive  modules/*/jar/*.jar

yields

java.base,java.compiler,java.desktop,java.logging,java.rmi

but when I try to create the jre, with the command

jlink --no-header-files --no-man-pages --compress=2 \
--add-modules java.base,java.compiler,java.desktop,java.logging,java.rmi \
--output jre

I have the following error

Error: jdk.tools.jlink.plugin.PluginException: Duplicate resources: {conf/logging.properties=[java.rmi, java.logging, java.prefs, java.xml]}

What did I do incorrectly ? Here is my Java information:

openjdk version "17.0.8" 2023-07-18 LTS
OpenJDK Runtime Environment Zulu17.44+15-CA (build 17.0.8+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.44+15-CA (build 17.0.8+7-LTS, mixed mode, sharing)

Upvotes: 2

Views: 104

Answers (1)

Stéphane Mottelet
Stéphane Mottelet

Reputation: 3014

It seems to be a regression of 17.0.8 version, as with

openjdk 17.0.3 2022-04-19 LTS
OpenJDK Runtime Environment Zulu17.34+19-CA (build 17.0.3+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.34+19-CA (build 17.0.3+7-LTS, mixed mode, sharing)

the jlink command runs fine.

Upvotes: 0

Related Questions