【发布时间】:2018-06-17 19:44:14
【问题描述】:
我正在将项目从 ANT 迁移到 MAVEN。
我设法创建了 JAR,并使用 Maven 生成了 Windows 可执行文件。然后唯一不起作用的就是显示启动画面。
顺便说一句:JAR 文件是用 MAVEN 生成的。 三种情况都使用同一个 JAR!
情况:
1)使用JAVA -JAR运行生成的JAR
正在显示初始屏幕:好的!
2) 使用 Launch4J GUI 和此配置文件构建相同的 JAR:OK
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>D:\Source\Java\ClientApplications\JavaTest\LrAnalyzer\target\LR Analyzer.jar</jar>
<outfile>D:\Source\Java\ClientApplications\JavaTest\LrAnalyzer\target\LR Analyzer.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon>D:\Dropbox\Jasper rapporten\Website\Icoontjes, plaatjes\Logo LightroomStatistics\logo alone.ico</icon>
<jre>
<path>jre</path>
<bundledJre64Bit>false</bundledJre64Bit>
<minVersion>1.7.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
</launch4jConfig>
3 使用 MAVEN 插件:没有闪屏,不行
问题:我错过了什么
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.21</version>
<executions>
<execution>
<id>${project.name}</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<jar>${project.build.directory}/${project.name}.jar</jar>
<outfile>${project.build.directory}/${project.name}.exe</outfile>
<downloadUrl>http://java.com/download</downloadUrl>
<classPath>
<mainClass>com.lightroomstatistics.main.LightroomStatisticsViewer</mainClass>
<preCp>anything</preCp>
</classPath>
<icon>D:\Dropbox\Jasper rapporten\Website\Icoontjes,
plaatjes\Logo LightroomStatistics\logo alone.ico</icon>
<jre>
<minVersion>1.8.0</minVersion>
<jdkPreference>preferJre</jdkPreference>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>${project.name}</fileDescription>
<copyright>2017 LightroomStatistics</copyright>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>1.0.0.0</txtProductVersion>
<productName>${project.name}</productName>
<companyName>LightroomStatistics.com</companyName>
<internalName>LightroomStatistics</internalName>
<originalFilename>LR-Analyzer.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
标签: java maven splash-screen launch4j