Reputation: 11
I am trying to use jlink to package a JavaFX application, and I am getting the following error when running mvn javafx:jlink
or mvn clean javafx:jlink
Error: automatic module cannot be used with jlink: com.github.oshi from file:///home/me/.m2/repository/com/github/oshi/oshi-core/6.6.2/oshi-core-6.6.2.jar
I have added moditect to my pom, because I read on a different thread that the issue is that it doesn't have a module-info file, but I am still getting this error. Here is what I have for moditect. I also want to say that idk what I'm doing with the --multi-release=21
arg, but I get other errors if I don't have it.
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.Final</version>
<executions>
<execution>
<id>generate-module-info</id>
<phase>generate-sources</phase>
<goals>
<goal>generate-module-info</goal>
</goals>
<configuration>
<modules>
<module>
<artifact>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</artifact>
</module>
</modules>
<jdepsExtraArgs>
<arg>--upgrade-module-path=...</arg>
<arg>--multi-release=21</arg>
</jdepsExtraArgs>
</configuration>
</execution>
</executions>
</plugin>
Upvotes: 1
Views: 30