Closed ghost closed 3 years ago
Here is toolchains.xml it wasn't rendering very well in main post for some reason:
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd">
<toolchain>
<type>jdk</type>
<provides>
<version>16</version>
</provides>
<configuration>
<jdkHome>C:\Users\diont\.jdks\openjdk-16.0.2</jdkHome>
</configuration>
</toolchain>
</toolchains>
I think I was over complicating it. I made a minimal test case and it seems to work without error.
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>org.dionthorn</groupId>
<artifactId>TestMaven</artifactId>
<version>1.0-SNAPSHOT</version>
<name>TestMaven</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-controls</artifactId>
<version>16</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>16</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>16</source>
<target>16</target>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.6</version>
<executions>
<execution>
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>org.dionthorn.testmaven/org.dionthorn.testmaven.HelloApplication</mainClass>
<noHeaderFiles>true</noHeaderFiles>
<stripDebug>true</stripDebug>
<noManPages>true</noManPages>
<launcher>App</launcher>
<jlinkImageName>App</jlinkImageName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.panteleyev</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>1.5.1</version>
<configuration>
<name>Test</name>
<appVersion>0.0.1</appVersion>
<vendor>org.dionthorn</vendor>
<destination>Runtime</destination>
<module>org.dionthorn.testmaven/org.dionthorn.testmaven.HelloApplication</module>
<runtimeImage>target/App</runtimeImage>
<type>MSI</type>
<winDirChooser>true</winDirChooser>
<winShortcut>true</winShortcut>
</configuration>
</plugin>
</plugins>
</build>
</project>
module-info.java
module org.dionthorn.testmaven {
requires javafx.controls;
requires javafx.fxml;
opens org.dionthorn.testmaven to javafx.fxml;
exports org.dionthorn.testmaven;
}
I removed toolchains and other plugins for minimalism. Must have been some configuration error I wasn't catching.
No this is actually a bug - your minimal config just avoids it by accident.
If you turn up the logging using your first config you will see the plugin is trying to run java
instead of jlink
- and --output
is not an option for the java
executable.
No this is actually a bug - your minimal config just avoids it by accident. If you turn up the logging using your first config you will see the plugin is trying to run
java
instead ofjlink
- and--output
is not an option for thejava
executable.
Thank you very much for your answer,for I just come across the same question.As you said, I use 'java' command but not 'jlink' command for !
the config should be like:
`
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>module-demo/com.demo.MainApplication</mainClass>
<jlinkExecutable>/xxxx/jdk17/bin/jlink</jlinkExecutable>
</configuration>
`
my previous error config is
`
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>module-demo/com.demo.MainApplication</mainClass>
<jlinkExecutable>/xxxx/jdk17/bin/java</jlinkExecutable>
</configuration>
`
javafx:run executes successfully javafx:jlink results in the following error (targeted to the top level error can provide full, large, error if needed)
The error:
--output seems to be from the jlinkImageName option I think.
pom.xml
I feel like I'm missing something obvious but I just can't get it to play nice. The toolchains.xml is new for me so not sure if that is correct setup. Could we maybe get an update on how to get the JLink working minimally with JDK 16 or am I moving too fast >.>?