30

The Problem

Currently I use exe4j 4.4.2 to wrap our client app in a Windows native executable, but the result does not integrate with Windows 7 so well.

For example: When I right click in the task bar it only offers a pop-up to close the application but no pinning. Eclipse' Equinox launcher on the other hand does that with bravado.

I'm looking for a java exe launcher which has the following features:

  • Wraps jars in Windows native executables (no Java Web Start or similar)
  • Doesn't extract the jar from the executable
  • Doesn't need write access in "Program Files"
  • Uses executable filename as process name (only one process)
  • Integrates well with Windows 7 (esp. pinning in the taskbar)
  • Allows setting of JVM arguments (esp. heap size)
  • Flexible customization for JRE search
  • Lightweight
  • Actively maintained
  • Integrates well in Ant build
  • Preferably free

I have checked the following:

exe4j

  • Windows 7 integration lacking
  • It's not expensive but ordering and distribution of licenses to the build machines is a pain.
  • JRE search not flexible enough

Eclipse Equinox

  • Not lightweight
  • Seems to do everything I want, except that I have no idea how to use it with a non-eclipse-based app.
  • Can I use it outside of OSGI, PDE-Build world?

WinRun4J

  • JRE search not well documented
  • Seems not widely used despite incredible feature set, what am I missing?

Launch4J

  • Doesn't support setting the process name in Windows 7 (Bug ID 3353972). There is a patch (Bug ID 1670471) but it has been rejected with reference to jliftoff which is dead.
  • JRE search not flexible enough.

JSmooth

  • Seems not to be actively maintained.
  • Latest release is from 2007, well before Windows 7.

Are there any other options? Is there a chance to use the Eclipse launcher with a non Eclipse-base application?

10
  • 2
    Sounds like what you really want is a howto on using the Eclipse native launcher without Equinox. Aug 17, 2011 at 11:47
  • 1
    AFAIK, intellij idea is using exe4j and it can be pinned. There could be something you'd have to do from code, I don't remember exactly. Aug 17, 2011 at 11:49
  • 1
    The native Eclipse launcher is a C shim which can be found in one of Eclipse's Git repositories.
    – Michael-O
    Aug 17, 2011 at 11:49
  • 2
    also, refer to this question: stackoverflow.com/questions/1834599/… Aug 17, 2011 at 11:52
  • 1
    @bbuser: I know very little about these parts as well, but from what I read in the documentation the launcher and Equinox (or SWT) are not too tightly coupled. And the launcher should be a reasonably small piece of software, so it should be possible to extract it without too much pain. Aug 17, 2011 at 12:11

4 Answers 4

3

Try Advanced Installer http://www.advancedinstaller.com/java.html (There is a free edition available in this).

1
  • Thanks, Advanced Installer looks very promising.
    – bbuser
    Sep 9, 2011 at 11:42
1

I'm happy with WinRun4J. The JRE search works fine for me. It sometimes chokes especially on 64bit systems if multiple JREs and JDKs are installed and registered in the Windows registry, but this can usually be fixed by supplying the correct path in the corresponding .ini file.

I did not use Launch4J because it creates a new (temporary) .exe in the JRE installation folder which seems a bit strange to me. The advantage of that method is, that it can use a single .exe for both 32 and 64 bit JVMs though

1
  • Thanks, that was the acknowledgement for WinRun4J I was looking for. Regarding the JRE search: It's not that I am unhappy with it, but that I have special requirements and I am looking for a solution that gives me precise control over what happens. Maybe WinRun4J does what I want, it's just not documented. With Launch4J the creation of the .exe is not only strange but fails on Windows 7, because one can't write in the JRE folder.
    – bbuser
    Sep 9, 2011 at 11:34
1

It sounds to me like you just need to go with Launch4J. The process name matches the .exe name that you launch with. A great example of a program that is wrapped this way is "Keystore Explorer 4.01".

3
  • As I said, Launch4J doesn't support setting the process name in Windows 7, and that is a no go in use case.
    – bbuser
    Sep 9, 2011 at 11:39
  • I was suggesting that you set the name before launch of the program by renaming the .exe dynamically.
    – djangofan
    Sep 9, 2011 at 15:10
  • Renaming the .exe dynamically fails in Windows7 because of access rights.
    – bbuser
    Sep 22, 2011 at 15:40
1

I would create a bat file. Wrap this bat file into a exe. You can create an exe with an icon and everything. Try this bat to exe converter:

http://download.cnet.com/Bat-To-Exe-Converter/3000-2069_4-10555897.html

In this way, you have better control. The size of the exe is very small.

Edit: Also, the creation of the exe is one time thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.