0

I am using JavaFX ant scripts to generate native bundles. The generated native executables use the name of the Main class. Is there any way to specify what the executable name should be? short of renaming the Main class?

I've scoured the Internet but have failed to find a configuration option that will do this. The specific reason I am running into this problem is that I am using another library (getdown) to launch my application, and because if this my main class name is the name of the Getdown main class, which will be confusing for my users.

  • According to the [packaging documentation](https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html#BCGGACFA) the `` ant build element has a `name` attribute for the application title. Does that not work? (I don't have something to test with, if it works I will post this as an answer.) – James_D Aug 16 '16 at 12:40
  • 1
    Just wanted to post the same answer. I can confirm, that defining a name in the fx:application Element works. – crusam Aug 16 '16 at 12:48
  • @crusam Thanks for confirming that works. – James_D Aug 16 '16 at 14:07

1 Answers1

1

The <fx:application> element of the <fx:build> target in build.xml defines a name attribute that is used for the application title. I.e. you can do

<fx:deploy width="${javafx.run.width}" height="${javafx.run.height}"
           nativeBundles="all"
           outdir="${basedir}/${dist.dir}" outfile="${application.title}">

    <fx:application name="My Cool App" mainClass="${javafx.main.class}"/>

    <!-- ... -->

</fx:deploy>

See the official documentation for more details.

James_D
  • 201,275
  • 16
  • 291
  • 322