我创建了一个“hello world”java 程序并使用 lauch4j 将可执行 jar 转换为 .exe 文件。当我尝试在 cmd 中运行它时,但没有打印出任何内容。我还尝试在 launch4j 中运行它。日志显示:正在执行:C:\Documents and Settings\cnbq84\Desktop\helloworld.exe。但是仍然没有显示“hello world”。
如何显示“Hello World”消息?
谢谢
这是我的配置文件:
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui|console</headerType>
<jar>C:\Documents and Settings\cnbq84\Desktop\helloworld.jar</jar>
<outfile>C:\Documents and Settings\cnbq84\Desktop\helloworld.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<customProcName>false</customProcName>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon></icon>
<jre>
<path>PATH</path>
<minVersion>1.4.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
</jre>
</launch4jConfig>
最佳答案
您可能未处于控制台模式。
来自 http://launch4j.sourceforge.net/docs.html
To wrap a jar in console mode use launch4jc.exe and specify the configuration file. launch4jc.exe config.xml
关于java - launch4j Hello World 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1060530/