[英]What's the alternative of a Java 10 secondary launcher on Mac OSX?
I'm using Maven to build a JavaFx project on Windows and Mac. 我正在使用Maven在Windows和Mac上构建JavaFx项目。 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.
我正在使用Maven-ant-plugin构建我的包,我的build.xml包含几个fx:secondaryLauncher块。辅助启动器使您能够在app目录中创建其他可执行文件,这些可执行文件将启动除主类之外的类。
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. 当我从Java 8切换到Java 10时 - maven通过maven-ant-plugin创建的软件包停止在Mac OSX上创建辅助启动器。 The fx:secondaryLauncher blocks seem to be ignored by the packager.
包装器似乎忽略了fx:secondaryLauncher块。
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 ). Windows程序包包含辅助启动程序,经过研究后我发现自Java 9发布以来 - “仅支持Windows和Linux应用程序的多个入口点” (完整文档: 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!
我宁愿最小化Windows和Mac OSX构建过程之间的差异(虽然这次可能无法;-))谢谢!
After researching several possible solutions it looks like the following solution is the best one : 在研究了几种可能的解决方案后,看起来以下解决方案是最好的解决方案:
this has several benefits : 这有几个好处:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.