我创建了一个“Hello World” Java程序,并使用lauch4j转换可执行的JAR到.exe文件。当我试图在cmd中运行它,但没有打印出来。我也试图在launch4j运行它。日志说明:执行:C:\ Documents和Settings \ cnbq84 \桌面\ 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

  

要包装在控制台模式使用一个罐子   launch4jc.exe并指定   配置文件。 launch4jc.exe   config.xml中

其他提示

原来我终于通过反复试验发现问题...

当我添加这些行:              hello.HelloWorld         hello.HelloWorld      一切正常。这似乎Launch4j找不到主(),如果你没有明确指定它。

感谢。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top