J2Exe - The best friend of every Java Developer




J2Exe project use the following parameters for making your exe:

  • Input parameters
  • System environment variables
  • Output parameters

Their explanation follows. An example and FAQ is available in section FAQ (see the link bellow).

Input parameters:

  • Java parameters: These are standard java parameters like classpath, system properties, extended parameters and etc.
  • Main class: Name of main class. You can omit it if you check "From Jar" checkbox. In this case the exe will search for main class clause in manifest of jar. Warning: "From Jar" feature is available from JDK1.2+. If you want to build exe that will work on JDK 1.1 you must not use it.
  • Application parameters: Parameters for Java main class. If you supply additional parameters when you start exe they are appended to these.
  • Working directory

Environment variables:
  • These properties are optional.
  • You can specify specific OS properties for exe like JAVA_HOME, ANT_HOME or any user specific. This feature was omitted in previous version of J2Exe because it was not GUI implemented.
  • The %APP_HOME% specifies the current location of exe on each machine. It is reserved for internal use and might be used to specify relative paths in your classpath, working directory and etc. (See input parameters)

Output properties:

  • Type: JDK with Console, JDK without Console or JDK with Managed Console.
  • Icon: You can click on icon to display file chooser dialog and to specify icon for your exe.
  • File: Absolute or relative location where the generated exe should be saved.

Managed console:

If you build executable file (or windows service) with managed console then you can find a menu item in system menu of every frame of your java applications. This menu item will give you the possibility to show and to hide console of your applications. This is useful for testing purpose because you can show standard console and to dump stack traces of all threads. During the rest of the time the console is hidden and your taskbar is free of it.

J2Exe Application's Image


Two additional classes are provided - WinTray.java and WinTrayListener.java. They are located in wintray.jar which is generated together with exe. Developer can use them to embed his own menu items into tray popup menu of application and to receive notification events when user clicks one of them. No additional natives are required.

The main window is marked by developer through setting its title to "WinTray". The original title can be set immediately after mark operation. This process is transparent for user. At the same time it provides unique method to mark main window no matter what GUI library (AWT, SWT, etc.) and JDK is used. It can be ommited for JDK1.4.x and AWT/Swing. Others might use invisible windows (like "createBuffer" in JDK1.2.2) and makes the task of determination of main window impossible.

Windows Service:

Generates standard windows service. The service is installed with " /install" and deinstalled with " /unstall".

Home Demo In/Out FAQ Plans License