I'm using Maven to build a JavaFx project on Windows and Mac. I'm using Maven-ant-plugin to build my package and my build.xml contains several fx:secondaryLauncher blocks.Secondary launchers enable you to create additional executables inside your app directory that will launch classes other than your main class.
Here is a sample from the official documentation:
<fx:info title="Test Suite"/>
<fx:secondaryLauncher
mainClass="samples.TestSuite"
name="Suite Applications"/>
shortcut="true"/>
<fx:secondaryLauncher name="Editor">
<fx:bundleArgument arg="icon" value="../resources/editor.ico"/>
</fx:secondaryLauncher>
<fx:secondaryLauncher name="Spreadsheet">
<fx:bundleArgument arg="icon" value="../resources/spreadsheet.ico"/>
</fx:secondaryLauncher>
When I switched from Java 8 to Java 10 - the package that maven creates via the maven-ant-plugin stopped creating the secondary launchers on Mac OSX. The fx:secondaryLauncher blocks seem to be ignored by the packager.
The Windows package DOES contain the secondary launchers and after researching a bit I found out that since Java 9 was released - "Multiple entry points are supported only for Windows and Linux applications" (full documentation here : https://docs.oracle.com/javase/9/deploy/self-contained-application-packaging.htm#JSDPG1000 ).
Does anyone have an idea about a good alternative to secondary launchers ? I would prefer to minimize the differences between Windows and Mac OSX build process (although it might not be able to this time ;-) ) Thanks!
After researching several possible solutions it looks like the following solution is the best one :
this has several benefits :
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.