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?

bbuser
  • 918
  • 11
  • 32
  • 2
    Sounds like what you *really* want is a howto on using the Eclipse native launcher without Equinox. – Joachim Sauer Aug 17 '11 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. – Denis Tulskiy Aug 17 '11 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 '11 at 11:49
  • 2
    also, refer to this question: http://stackoverflow.com/questions/1834599/pinning-a-java-application-to-the-windows-7-taskbar – Denis Tulskiy Aug 17 '11 at 11:52
  • @Joachim: I know little about the inner workings of Eclipse, do you think it is possible to use the launcher without the rest? – bbuser Aug 17 '11 at 12:03
  • 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. – Joachim Sauer Aug 17 '11 at 12:11
  • 1
    For the Windows 7 integration, check out [j7goodies](http://www.strixcode.com/j7goodies/). It offers pinning, taskbar progress bar, etc. It doesn't do .exe bundling and is not free, but maybe it can be combined with the above? – Steven Aug 23 '11 at 19:03
  • 1
    Just as a matter of interest, I don't think the eclipse application launcher fulfils your criteria on windows 7 either: It gives you two processes, one called eclipse.exe, another javaw.exe. At least when I run Eclipse it does that. – Matthew Farwell Aug 24 '11 at 08:26
  • @Matthew Farwell: When I start a fresh eclipse I see only eclipse.exe, the javaw.exe child only appears when I start my application from eclipse. I don't think the javaw.exe you see belongs to eclipse itself. – bbuser Sep 09 '11 at 11:50
  • @bbuser. Interesting. It creates the sub-process in Galileo, but not in Helios. Ok, I withdraw my comment, maybe it will work. If you use Helios. – Matthew Farwell Sep 09 '11 at 12:27

4 Answers4

3

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

Ravindra Gullapalli
  • 8,591
  • 3
  • 41
  • 66
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".

djangofan
  • 25,461
  • 54
  • 171
  • 262
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

a_horse_with_no_name
  • 440,273
  • 77
  • 685
  • 758
  • 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 09 '11 at 11:34
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.

sethu
  • 7,407
  • 5
  • 35
  • 61