Lauch4j hello world program

I created a java program "hello world" and used lauch4j to convert the executable jar to an .exe file. When I tried to run it in cmd but it didn't print anything. I also tried running it in launch4j. Log indicates: Execution: C: \ Documents and Settings \ cnbq84 \ Desktop \ helloworld.exe. But until now "hello world" is not displayed.

How do I display the "Hello World" message?

thank

Here is my config file:

<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>

      

+2


source to share


2 answers


You may not be in console mode.

From http://launch4j.sourceforge.net/docs.html



To wrap the jar in console mode use launch4jc.exe and point to the config file. launch4jc.exe config.xml

+2


source


It turns out I finally discovered the problem through trial and error ...

When I add these lines: hello.HelloWorld hello.HelloWorld Everything works. It seems Launch4j cannot find main () unless you specify it explicitly.



Thank.

0


source







All Articles