Reputation: 353
Using this tutorial: http://mark.koli.ch/bundle-java-the-jre-and-launch-a-java-app-with-7zip-sfx
I'm trying to put the jre and my .jar together,to result of a single executable file, so the JRE will not be required to launch my application.
I use Eclipse to export my project into an executable app.jar file. (file - export - jar, executable jar). Then, I zip the jre and app.jar together:
app.7z:
- jre folder
- app.jar
My app.tag contains this:
;!@Install@!UTF-8!
Title="7ZIP Java Launcher Example"
ExtractDialogText="Extracting ..."
GUIFlags="32"
ExtractTitle="Extracting"
FinishMessage="Application stopped."
RunProgram="jre\bin\javaw.exe -jar app.jar \"%%S\" \"%%T\""
;!@InstallEnd@!
Then, I put app.tag, app.7z and 7zSD.sfx into the same folder and use this command line:
C:\> copy /b 7zSD.sfx + app.tag + app.7z start.exe
The file start.exe is created. When I open it, it says "extracting...", but will always launch "Application stopped". I have no clue why this happens. I checked into the TEMP of Windows folder, and everything is extracted correctly.
Any idea what I am doing wrong? The .jar itself will open normally when I double-click on it.
Thank you!
Upvotes: 0
Views: 963
Reputation: 11
I suggest to get the 7zSD.sfx from a previous 7-Zip extra package.
http://www.7-zip.org/a/7z920_extra.7z
Upvotes: 1