Reputation: 187
When trying to use jlink on Fedora from this plugin https://github.com/openjfx/javafx-maven-plugin
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
Pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.alcamech</groupId>
<artifactId>jomo</artifactId>
<version>1.0-SNAPSHOT</version>
<name>jomo</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.7.1</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>17.0.0.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.0.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.0.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<compress>2</compress>
<noHeaderFiles>true</noHeaderFiles>
<stripDebug>true</stripDebug>
<noManPages>true</noManPages>
<launcher>jomo</launcher>
<mainClass>com.alcamech.jomo/com.alcamech.jomo.Jomo</mainClass>
<jlinkImageName>jomo</jlinkImageName>
<jlinkZipName>jomo</jlinkZipName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
module-info.java
module com.alcamech.jomo {
requires javafx.controls;
requires javafx.fxml;
requires javafx.media;
opens com.alcamech.jomo to javafx.fxml;
exports com.alcamech.jomo;
}
I get the following error
Error: Module java.base not found, required by com.alcamech.jomo
Running java --list-modules
returns.
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Currently on
Fedora release 35 (Thirty Five), 5.15.13-200.fc35.x86_64
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)
I got this error while also following the sample project(Modular Intellij, Modular CLI) from https://openjfx.io/openjfx-docs/. Cloning my project repo on windows and running the jlink command is successful. I've tried the jlink command through the CLI on linux and got the same error. I've opened a github issue with a full maven log here https://github.com/openjfx/javafx-maven-plugin/issues/146
Debug jlink command line from mvn javafx:link output:
[DEBUG] Executing command line: [/usr/lib/jvm/java-11-openjdk/bin/jlink, --module-path, /home/alcamech/Development/jomo/target/classes:/home/alcamech/.m2/repository/org/openjfx/javafx-base/17.0.0.1/javafx-base-17.0.0.1-linux.jar:/home/alcamech/.m2/repository/org/openjfx/javafx-controls/17.0.0.1/javafx-controls-17.0.0.1-linux.jar:/home/alcamech/.m2/repository/org/openjfx/javafx-fxml/17.0.0.1/javafx-fxml-17.0.0.1-linux.jar:/home/alcamech/.m2/repository/org/openjfx/javafx-graphics/17.0.0.1/javafx-graphics-17.0.0.1-linux.jar:/home/alcamech/.m2/repository/org/openjfx/javafx-media/17.0.0.1/javafx-media-17.0.0.1-linux.jar, --add-modules, com.alcamech.jomo, --output, /home/alcamech/Development/jomo/target/image, --compress, 0]
Upvotes: 4
Views: 1760
Reputation: 187
I am missing the jmods directory in my jdk. On Fedora jmods are a separate install
https://fedora.pkgs.org/35/fedora-x86_64/java-11-openjdk-jmods-11.0.12.0.7-4.fc35.x86_64.rpm.html
Run sudo dnf install java-11-openjdk-jmods
Upvotes: 5