Обернутое приложение launch4j не запускается, что я делаю не так?
Когда я пытаюсь запустить свое приложение, я вижу небольшой диалог с названием моего приложения, который мигает на экране и быстро исчезает. Запуск моего приложения из jar
работает:
java -cp target\dashman-1.0.0-beta.2.jar tech.dashman.dashman.ConfiguratorApp
Я копирую JRE следующим образом:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/windows/jre</outputDirectory>
<resources>
<resource>
<directory>${java.home}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
и я упаковываю приложение так:
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<executions>
<execution>
<id>dashman</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>target/windows/Dashman.exe</outfile>
<jar>target/dashman-1.0.0-beta.2.jar</jar>
<errTitle>Dashman</errTitle>
<supportUrl>https://support.dashman.tech</supportUrl>
<restartOnCrash>true</restartOnCrash>
<icon>src\main\deploy\package\windows\Dashman.ico</icon>
<classPath>
<mainClass>tech.dashman.dashman.ConfiguratorApp</mainClass>
</classPath>
<singleInstance>
<mutexName>dashman-configurator</mutexName>
</singleInstance>
<jre>
<path>jre</path>
</jre>
<!-- TODO: splash -->
<versionInfo>
<fileVersion>0.251.2.0</fileVersion> <!-- Equivalent to 1.0.0-beta.2 -->
<txtFileVersion>1.0.0-beta.2</txtFileVersion>
<fileDescription>Dashman, the ultimate dashboard manager</fileDescription>
<copyright>Copyright 2018 Flexpoint Tech Ltd. All rights reserved</copyright>
<productVersion>0.251.2.0</productVersion>
<txtProductVersion>1.0.0-beta.2</txtProductVersion>
<productName>Dashman</productName>
<companyName>Flexpoint Tech</companyName>
<internalName>Dashman</internalName>
<originalFilename>Dashman.exe</originalFilename>
<language>en</language>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>