4

I am using launch4j for the first time and I get following error. Here is launch4j error log.

Compiling resources
Generated resource file...
LANGUAGE 0, 1
2 RCDATA BEGIN "1.5.0\0" END
18 RCDATA BEGIN "1\0" END
21 RCDATA BEGIN "http://java.com/download\0" END
20 RCDATA BEGIN "32\0" END
101 RCDATA BEGIN "An error occurred while starting the application.\0" END
102 RCDATA BEGIN "This application was configured to use a 
bundled Java Runtime Environment but the runtime is missing or corrupted.\0" END
103 RCDATA BEGIN "This application requires a Java Runtime Environment\0" END
104 RCDATA BEGIN "The registry refers to a nonexistent
Java Runtime Environment installation or the runtime is corrupted.\0" END
17 RCDATA BEGIN "true\0" END

and here is generated xml file

<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>/DesktopApp/launch4j/applicationname.jar</jar>
<outfile>/DesktopApp/launch4j/applicationname.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon></icon>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<minVersion>1.5.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
</jre>
</launch4jConfig>

Your help will be very much appreciated.If there are alternative for launch4j then please tell me.

saurabh
  • 209
  • 1
  • 4
  • 17

8 Answers8

14

I was trying to use a *.png file as my icon but it wanted *.ico. Once I removed <icon>...</icon> from my config file this error disappeared.

giraffe.guru
  • 480
  • 8
  • 21
3

I ran launch4j application as administrator and the error disappeared for me.

3

Check the icon file you are using (if you are using one). I was coming across the same error when trying to wrap my java executable. I was using a png file that I converted to what I thought was an icon (.ico) file. Turns out this conversion didn't work. After using a correct .ico file I found on my windows system, I used that and it worked.

JC3
  • 31
  • 3
2

Convert your png or jpeg fiel to icon file and error will go.

You can use online tool:- http://iconverticons.com/online/

BakaitBaba
  • 181
  • 5
1

The reason is a version of JRE on machine where EXE file is executing.

svichkar
  • 1,806
  • 1
  • 17
  • 23
  • Please explain your answer a little bit further.. How version of JRE causes the problem ? – Rahul Vishwakarma Mar 04 '15 at 14:45
  • I got this error “This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted” when version of my JRE doesn't match to version on machine where EXE file is executing. – svichkar Mar 11 '15 at 14:42
  • 1
    I have JRE 1.8.0 on my machine. I've generated EXE file using default setting with Launch4j program. Then this EXE couldn't be executed on machines where JRE version doesn't match with 1.8.0. The solution is - to specify "Min JRE version" as the earliest JRE version on JRE tab of Settings, e.g. 1.5.0 as I did. Please see my screenShot https://www.dropbox.com/s/ia34ccc7tf3nhpb/JRE_tab.png?dl=0 – svichkar Mar 11 '15 at 14:52
1

Give the path as \bin\jre_path For instance if you have a folder dist with bin as subfolder having the jre file inside.

0

None of the above helped me. The answer was to copy JRE's lib and bin folders into a new folder inside dist (I called it jre), then use that folder name as the Bundled JRE Path:enter image description here

jazzwhistle
  • 337
  • 2
  • 12
0

[launch4j for Windows][1]

Make sure your launch4j got an '.exe' extension and not '.jar' if you using windows [1]: https://sourceforge.net/projects/launch4j/

hopefully that helps.

Rach
  • 1