我使用的是IzPack5.1.2,根据文档,下面的内容用于启用调试信息:
java -DDEBUG=true -jar installer.jar
java -DSTACKTRACE=true -jar installer.jar
java -DTRACE=true -jar installer.jar还包括:
<guiprefs>
<modifier key="showDebugWindow" value="true"/>
</guiprefs> 因此,我假设禁用调试信息,这样调试窗口就不会显示,我只需要将上面的内容更改为false。
不幸的是,即使在将上述所有设置为false之后,当我执行安装程序时,调试窗口仍然显示。
为了为java工件创建一个exe,我将其包装为launch4j,添加了将java变量设置为false的部分:
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<executions>
<execution>
<id>l4j-clui</id>
<phase>install</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>console</headerType>
<jar>target/${installer-output-filename}.jar</jar>
<outfile>target/${installer-output-filename}.exe</outfile>
<classPath>
<mainClass>com.izforge.izpack.installer.bootstrap.Installer</mainClass>
</classPath>
<downloadUrl>http://java.com/download</downloadUrl>
<jre>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>1.8.0</minVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64</runtimeBits>
<opts>
<opt>-DTRACE=false</opt>
<opt>-DSTACKTRACE=false</opt>
<opt>-DDEBUG=false</opt>
</opts>
</jre>
....我不明白为什么在将所有调试变量设置为false之后,调试窗口仍然显示。
发布于 2017-11-03 21:50:48
问题不在IzPack配置上,而是在Launch4J配置上,因为headerType标记配置错误:
<headerType>console</headerType>为了禁用控制台输出,我应该使用gui选项:
<headerType>gui</headerType>https://stackoverflow.com/questions/47038866
复制相似问题