javafx-maven-plugin eclipse java version

Tom Eugelink tbee at tbee.org
Sun Mar 28 11:12:27 UTC 2021


Added toolchains support to javafx-maven-plugin and created a PR.
https://github.com/openjfx/javafx-maven-plugin/pull/118

So you can do:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>${maven.compiler.release}</version>
</jdk>
</toolchains>
</configuration>
</plugin>

That will make sure the same JDK is used for compiling and javafx:run (given the PR is merged).

The easiest way to get that setup is using sdkman, install the required jdks, then also install jbang (sdk install jbang) and run 'jbang sdkman at tbee/mavenToolchains'




On 2021-03-27 10:47, Tom Eugelink wrote:
> The plugin has an executable option which can refer to the java executable. Per it uses the system default, which apparently is different between my bash and the shell that eclipse uses. If I hard code the correct path, it works correctly.
>
> But a hardcoded path is not okay, so I'm going to try and see if I can make a PR so the plugin use the same java as the compiler. That would make it less unpredictable. And possibly use toolchains, since I now know it exists :-)
>



More information about the openjfx-dev mailing list