launch4j/OneJAR packed .exe file corrupted

899 Views Asked by At

I'm using OneJAR to package my application into a single jar.

The OneJAR created .jar file launches perfectly on Windows and the JOGL code runs fine.

I then I turn this .jar file into an .exe file using launch4j.

When I try to execute that file, Windows (7) reports that the file is corrupt.

My application includes some native code (JOGL DLL's) which I suspect maybe related.

If I create an executable jar without OneJAR and turn this into .exe that lauches alright, though it the complains about the missing JOGL DLL's (naturally as they cannot be included in the jar without something like OneJAR).

So has anyone made that combination OneJAR+launch4j+DLLs work or is this something that is not going to work?

2

There are 2 best solutions below

2
On

try JarSplice, it worked fine for me with Launch4j.

0
On

Problem solve, see my comment on Gavin's Answer, silly mistake of mine.

Bah, silly mistake of mine, sorry about the noise. The problem was that my Ant-script had a jstub Ant-task that mangled the .jar file before launch4j had a chance to do its magic. So I can report that OneJAR and launch4j work perfectly together, highly recommended.