Re: Build standalone executable



carl.manaster@xxxxxxxxx wrote:
Hi, all,

I'm sorry if this is a silly question,

Don't be, it isn't.

but I've googled without
success. I have a little applet that processes some numbers and plots
them; it uses classes from my own body of code and from libraries like
JFreeChart. I want to package this up into a standalone application
that I can put on my colleague's desktop so he can try it out. We're
both on the same OS, Windows. I'm using Eclipse.

I have wrapped the JApplet up with a main() that creates a new JFrame,
pops the applet into it, and handles window close. I can run from the
Eclipse environment as either an applet or an application. It does
what I want. I don't want to put it on a web page, just create a
standalone executable. It does not need to be able to run across
multiple platforms; just Windows. What are the steps to do this? I
would like for Eclipse to figure out the dependencies and bundle
together whatever classes it needs. No fancy icon, just something my
colleague can double-click to launch. Thanks for any help with this.


This is a FAQ, the answers I've seen include:

1. Create an executable Jar. These can be run by double clicking and icon on a Windows PC which has a JRE installed. It won't work without a JRE. AFAIK this is the only deployment option supported by plain old Eclipse. Eclipse can produce the Jar but doesn't package it in an installer (setup-appname.exe). There are at least a dozen 3rd party installers that will package up a Jar file for installation. The commercial/proprietary ones seem the most fully featured. Some installers still depend on a JRE being already installed on the target.

2. Use Java Webstart. This works well once the JRE is installed. I suspect the whole installation process, for a brand-new Windows XP PC without JWS/JRE preloaded, is still rather longer and more complicated than most people would want.

3. Use an EXE wrapper. E.g. JSmooth. This can also take care of finding a suitable JRE and downloading it as needed. Installing a JRE is still an intrusive operation for end-users.

4. Compile to native binary. E.g. Gnu GCJ and Gnu Classpath. http://javacompiler.mtsystems.ch/ is one packaging of GCJ. Excelsior Jet is a commercial solution. No JRE required AIUI.

With 3 & 4 you can use a normal Windows installer to install the exe with desktop icons etc.

As I see it, each of the above have their pros and cons, so no one solution is right for all circumstances.

Some selection criteria (targeting Windows):
- How big is the installer bundle?
- Does the user have to work through Sun's JRE download procedure?
- Do shortcuts get installed (with icon) in Start menu & Desktop?
- Does the app get listed in Windows Control-Panel Add/Remove Programs?
- Is the running app listed under its own name in Task Manager?


For a one-off, small app, targeting a friend/colleagues PC, I'd use an executable Jar. YMMV.

--
Ian.
.



Relevant Pages

  • Windows Installer und JAVA-JRE-Update
    ... erhalte seid einiger Zeit beim JRE-Update eine Fehlermeldung, der Windows ... Die Meldung ist mit Windows Installerübertitelt. ... Wenn ich versuche nicht den Update von JRE sondern das ganze JRE einzuspielen, ... dann kommt eine Windows Installer Meldung mit "Fehler bei der Anmeldung von ...
    (microsoft.public.de.german.windowsxp.setup)
  • Re: Smaller package for users without JRE
    ... If I bundle up the JRE folder with my small application, ... JRE installer for Windows is only 15.5 MB. ... It is the installed JRE folder that is that large. ...
    (comp.lang.java.programmer)
  • Re: Smaller package for users without JRE
    ... If I bundle up the JRE folder with my small application, ... JRE installer for Windows is only 15.5 MB. ... It is the installed JRE folder that is that large. ...
    (comp.lang.java.programmer)
  • Re: ¿How to make run a virtual machine from a CD automatically ?
    ... they're essentially a collection of all the files required for a JRE. ... It's considered "private" in Windows, ... JRE being used was the one provided with the installer and is therefore ... Steve W. Jackson ...
    (comp.lang.java.programmer)
  • NewestShareware.com Issue #239
    ... your Windows Mobile smartphone in real time. ... Price: 0.00 ... Download file size: 1899 K ... Improved installer. ...
    (comp.software.shareware.announce)