java - launch4j Hello World 程序

标签 java windows exe launch4j

我创建了一个“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/

相关文章:

java - 部分字符串匹配

java - HQL QuerySyntaxException : unexpected token 错误

java - if-else 语句不适用于模型

linux - Jboss-6.1 应用程序运行速度非常慢

windows - CMD: Bat to Exe Converter - 临时目录问题

windows - 有没有办法制作只能播放一次的音频文件?

linux - 无法安装 Java 6 和安装 7

python - 如何在python中获取文件关闭事件

c++ - 如何在 Windows 上静态链接 FFTW?

exe - offset 和 RVA 的区别