| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Launch4j - Cross-platform Java executable wrapper</title>
- <meta name="description" content="Cross-platform Java executable wrapper for creating lightweight Windows native EXEs. Provides advanced JRE search, application startup configuration and better user experience.">
- <meta name="keywords" content="java executable wrapper, java application wrapper, exe wrapper, jar wrapper, wrap, wraps, wrapping, free software, launch, launcher, linux, mac, windows, open source, ant, native splash screen, deploy, build tool">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="author" content="Grzegorz Kowal" >
- <link rel="stylesheet" type="text/css" href="style-13112022.css">
- </head>
- <body>
- <div id="container">
- <div id="top">
- <img style="width: 249px; height: 58px;" src="launch4j.gif" alt="launch4j"> <span class="version">3.50</span>
- </div>
- <div class="sidebar">
- <div id="leftnav">
- <ul>
- <li><a href="index.html">Home</a></li>
- <li><a href="docs.html">Docs</a></li>
- <li><a href="changelog.html">Changelog</a></li>
- <li><a href="http://sourceforge.net/project/screenshots.php?group_id=95944">Screenshots</a></li>
- <li><a href="http://sourceforge.net/projects/launch4j/files/launch4j-3/3.50">Download</a></li>
- <li><a href="http://sourceforge.net/projects/launch4j/support">Support</a></li>
- <li><a href="http://sourceforge.net/projects/launch4j">Project summary</a></li>
- <li><a href="http://sourceforge.net/tracker/?atid=613100&group_id=95944">Bug tracker</a></li>
- <li><a href="links.html">Links</a></li>
- </ul>
- </div>
- <div style="margin: 30px 0px 10px 10px">
- <a class="button" href="https://sourceforge.net/projects/launch4j/files/latest/download"><img alt="Download Launch4j Executable Wrapper" src="https://img.shields.io/sourceforge/dt/launch4j.svg" ></a>
- </div>
- <!-- Begin SF Tag -->
- <div class="sf-root" data-id="95944" data-badge="oss-open-source-excellence-white" data-metadata="achievement=oss-open-source-excellence" style="width:125px">
- <a href="https://sourceforge.net/projects/launch4j/" target="_blank">Launch4j Executable Wrapper</a>
- </div>
- <script>(function () {var sc=document.createElement('script');sc.async=true;sc.src='https://b.sf-syn.com/badge_js?sf_id=95944';var p=document.getElementsByTagName('script')[0];p.parentNode.insertBefore(sc, p);})();
- </script>
- <!-- End SF Tag -->
- </div>
- <div id="content">
- <a href="#Running_launch4j">Running launch4j</a><br>
- <a href="#Configuration_file">Configuration file</a><br>
- <a href="#Importing_1.x_configuration">Importing 1.x configuration</a><br>
- <a href="#Ant_task">Ant Task</a><br>
- <a href="#Additional_jvm_options">Additional JVM options at runtime</a><br>
- <a href="#Runtime_options">Runtime options</a><br>
- <a href="#Settings">Settings</a><br>
- <h2 id="Running_launch4j">Running launch4j</h2>
- Run <em>launch4j.exe</em> or <em>launch4j</em> script without command
- line arguments to enter the GUI mode.
- <pre>launch4j.exe</pre>
- To wrap a jar in console mode use <em>launch4jc.exe</em> <em></em>and
- specify the configuration file.
- <pre>launch4jc.exe config.xml</pre>
- On Linux use the <em>launch4j</em> script.
- <pre>launch4j ./demo/l4j/config.xml</pre>
- <h2 id="Configuration_file">Configuration file</h2>
- Launch4j requires an xml configuration file for each output executable.
- You can create and edit it conveniently using the graphic user
- interface or your favorite editor. Alternatively it's possible to pass
- all of the configuration parameters through the Ant task. All files
- may be absolute paths or relative to the configuration file path.<br />
- <strong class="warn">Launch4j 3.50</strong> Configuration changes:
- <ul>
- <li>Removed <em><bundledJreAsFallback></em>, path search is always first and registry search second
- in order to improve compatibility with modern runtimes.</li>
- <li>Replaced <em><bundledJre64Bit></em> and <em><runtimeBits></em> with <em><requires64Bit></em>
- which works during path and registry search.</li>
- <li>Replaced <em><jdkPreference></em> with <em><requiresJdk></em> which works during path and registry search.</li>
- <li>Replaced <em><bundledJreErr></em> with <em><jreNotFoundErr></em>.
- <li><em><minVersion></em> and <em><maxVersion></em> are now used during path and registry search, previously
- they were only checked during registry search.</li>
- </ul>
- <pre>
- <!--
- <strong>Bold</strong> elements are required.
- <span class="codeword"><u>Underlined</u></span> values are the default when the element is not specified.
- %VAR% expands environment/special variables and registry keys.
- -->
- <strong><launch4jConfig></strong>
- <strong><headerType></strong><span class="codeword">gui|console|jniGui32|jniConsole32</span><strong></headerType></strong>
- <strong><outfile></strong><span class="codeword">file.exe</span><strong><span class="codeword"></span></outfile></strong>
- <jar><span class="codeword">file</span><span class="codeword"></span></jar>
- <dontWrapJar><span class="codeword">true|<u>false</u></span></dontWrapJar>
- <errTitle><span class="codeword">application name</span></errTitle>
- <downloadUrl><span class="codeword"><u>http://java.com/download</u></span></downloadUrl>
- <supportUrl><span class="codeword">url</span></supportUrl>
- <cmdLine><span class="codeword">text</span></cmdLine>
- <chdir><span class="codeword">path</span></chdir>
- <priority><span class="codeword"><u>normal</u>|idle|high</span></priority>
- <stayAlive><span class="codeword">true|false</span></stayAlive>
- <restartOnCrash><span class="codeword">true|false</span></restartOnCrash>
- <icon><span class="codeword">file</span></icon>
- <obj><span class="codeword">header object file</span></obj>
- ...
- <lib><span class="codeword">w32api lib</span></lib>
- ...
- <var><span class="codeword">var=text (%VAR%)</span></var>
- ...
- <classPath>
- <strong><mainClass></strong><span class="codeword">main class</span><strong></mainClass></strong>
- <strong><cp></strong><span class="codeword">classpath (%VAR%)</span><strong></cp></strong>
- ...
- </classPath>
- <singleInstance>
- <strong><mutexName></strong><span class="codeword">text</span><strong></mutexName></strong>
- <windowTitle><span class="codeword">text</span></windowTitle>
- </singleInstance>
- <strong><jre></strong>
- <strong><path></strong><span class="codeword">JRE path (%VAR%)</span><strong></path></strong>
- <requiresJdk><span class="codeword">true|<u>false</u></span></requiresJdk>
- <requires64Bit><span class="codeword">true|<u>false</u></span></requires64Bit>
- <minVersion><span class="codeword">1.x.x[_xxx]|xxx[.xxx[.xxx]]</span></minVersion>
- <maxVersion><span class="codeword">1.x.x[_xxx]|xxx[.xxx[.xxx]]</span></maxVersion>
- <!-- Heap sizes in MB and % of available memory. -->
- <initialHeapSize><span class="codeword">MB</span></initialHeapSize>
- <initialHeapPercent><span class="codeword">%</span></initialHeapPercent>
- <maxHeapSize><span class="codeword">MB</span></maxHeapSize>
- <maxHeapPercent><span class="codeword">%</span></maxHeapPercent>
- <opt><span class="codeword">text (%VAR%)</span></opt>
- ...
- <strong></jre></strong>
- <splash>
- <strong><file></strong><span class="codeword">file</span><strong></file></strong>
- <waitForWindow><span class="codeword"><u>true</u>|false</span></waitForWindow>
- <timeout><span class="codeword">seconds [60]</span></timeout>
- <timeoutErr><span class="codeword"><u>true</u>|false</span></timeoutErr>
- </splash>
- <versionInfo>
- <strong><fileVersion></strong><span class="codeword">x.x.x.x</span><strong></fileVersion></strong>
- <strong><txtFileVersion></strong><span class="codeword">text</span><strong></txtFileVersion></strong>
- <strong><fileDescription></strong><span class="codeword">text</span><strong></fileDescription></strong>
- <strong><copyright></strong><span class="codeword">text</span><strong></copyright></strong>
- <strong><productVersion></strong><span class="codeword">x.x.x.x</span><strong></productVersion></strong>
- <strong><txtProductVersion></strong><span class="codeword">text</span><strong></txtProductVersion></strong>
- <strong><productName></strong><span class="codeword">text</span><strong></productName></strong>
- <companyName><span class="codeword">text</span></companyName>
- <strong><internalName></strong><span class="codeword">filename</span><strong></internalName></strong>
- <strong><originalFilename></strong><span class="codeword">filename.exe</span><strong></originalFilename></strong>
- <trademarks><span class="codeword">text</span></trademarks>
- <language><span class="codeword">
- ALBANIAN|ARABIC|BAHASA|DUTCH_BELGIAN|FRENCH_BELGIAN|BULGARIAN|
- FRENCH_CANADIAN|CASTILIAN_SPANISH|CATALAN|CROATO_SERBIAN_LATIN|
- CZECH|DANISH|DUTCH|ENGLISH_UK|<u>ENGLISH_US</u>|FINNISH|FRENCH|GERMAN|
- GREEK|HEBREW|HUNGARIAN|ICELANDIC|ITALIAN|JAPANESE|KOREAN|
- NORWEGIAN_BOKMAL|NORWEGIAN_NYNORSK|POLISH|PORTUGUESE_BRAZIL|
- PORTUGUESE_PORTUGAL|RHAETO_ROMANIC|ROMANIAN|RUSSIAN|
- SERBO_CROATIAN_CYRILLIC|SIMPLIFIED_CHINESE|SLOVAK|SPANISH_MEXICO|
- SWEDISH|FRENCH_SWISS|GERMAN_SWISS|ITALIAN_SWISS|THAI|
- TRADITIONAL_CHINESE|TURKISH|URDU
- </span></language>
- </versionInfo>
- <messages>
- <strong><startupErr></strong>text<strong></startupErr></strong>
- <strong><jreNotFoundErr></strong>text<strong></jreNotFoundErr></strong>
- <strong><jreVersionErr></strong>text<strong></jreVersionErr></strong>
- <strong><launcherErr></strong>text<strong></launcherErr></strong>
- <!-- Used by console header only. -->
- <strong><instanceAlreadyExistsMsg></strong>text<strong></instanceAlreadyExistsMsg></strong>
- </messages>
- <strong></launch4jConfig></strong>
- </pre>
- <dl>
- <dt><headerType></dt>
- <dd>
- Type of the header used to wrap the application.
- <table>
- <thead>
- <tr>
- <th>Header type</th>
- <th>Launcher</th>
- <th>Splash screen</th>
- <th style="white-space: nowrap">Wait for the application to close</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>gui</td>
- <td>javaw</td>
- <td>yes</td>
- <td class="description">wrapper waits only if <em>stayAlive</em> is set to true,
- otherwise it terminates immediately or after closing
- the splash screen.
- </td>
- </tr>
- <tr>
- <td>console</td>
- <td>java</td>
- <td>no</td>
- <td class="description">always waits and returns application's exit code.</td>
- </tr>
- <tr>
- <td>jniGui32 <strong style="color: red">(beta)</strong></td>
- <td>launch4j</td>
- <td>yes</td>
- <td class="description">always waits and returns application's exit code.</td>
- </tr>
- <tr>
- <td>jniConsole32 <strong style="color: red">(beta)</strong></td>
- <td>launch4j</td>
- <td>no</td>
- <td class="description">always waits and returns application's exit code.</td>
- </tr>
- </tbody>
- </table>
- <br />
- When JNI headers are used the JVM is created directly by the launch4j wrapper executable instead of running java/javaw launchers.
- The process name will be the same as the wrapper. The JNI headers are in BETA and some features are not available which is signaled
- during wrapper build based on the configuration.
- For production use consider the classic gui/console headers.
- <br />
- Missing features:
- <ul>
- <li>Only '.' is allowed in change directory (chdir).</li>
- <li>Command line arguments cannot be passed to the executable.</li>
- <li>Constant command line arguments (cmdLine).</li>
- <li>stayAlive should be ignored by JNI headers.</li>
- <li>Restart of appplication based on exit code (restartOnCrash).</li>
- <li>Process priority - only normal is supported (priority).</li>
- <li>Jar manifest is ignored, mainclass and classpath must be defined.</li>
- <li>64-bit JRE are not supported.</li>
- </ul>
- </dd>
- </dl>
- <dl>
- <dt><outfile></dt>
- <dd>Output executable file.</dd>
- </dl>
- <dl>
- <dt><jar></dt>
- <dd>
- Optional, by default specifies the jar to wrap. To launch a jar without
- wrapping it enter the runtime path of the jar relative to
- the executable and set <em><dontWrapJar></em> to true.
- For example, if the executable launcher and the application jar named
- <i>calc.exe</i> and <i>calc.jar</i> are in the same directory
- then you would use <i><jar>calc.jar</jar></i>
- and <em><dontWrapJar>true</dontWrapJar></em>.
- </dd>
- </dl>
- <dl>
- <dt><dontWrapJar></dt>
- <dd>
- Optional, defaults to false. Launch4j by default wraps jars in native
- executables, you can prevent this by setting <em><dontWrapJar></em> to true.
- The exe acts then as a launcher and starts the application specified in
- <em><jar></em> or <em><classPath><mainClass></em>
- </dd>
- </dl>
- <dl>
- <dt><errTitle></dt>
- <dd>
- Optional, sets the title of the error message box that's displayed if Java cannot
- be found for instance. This usually should contain the name of your
- application. The console header prefixes error messages with this
- property (myapp: error...)
- </dd>
- </dl>
- <dl>
- <dt><cmdLine></dt>
- <dd>Optional, constant command line arguments.</dd>
- </dl>
- <dl>
- <dt><chdir></dt>
- <dd>Optional. Change current directory to an arbitrary path relative to the executable.
- If you omit this property or leave it blank it will have no effect.
- Setting it to <em>.</em> will change the current dir to the same directory
- as the executable. <em>..</em> will change it to the parent directory, and so on.
- </dd>
- <dd>
- <pre><chdir>.</chdir></pre>
- </dd>
- <dd>
- <pre><chdir>../somedir</chdir></pre>
- </dd>
- </dl>
- <dl>
- <dt><stayAlive></dt>
- <dd>Optional, defaults to false in GUI header, always true in console header.
- When enabled the launcher waits for the Java application
- to finish and returns it's exit code.
- </dd>
- </dl>
- <dl>
- <dt><restartOnCrash></dt>
- <dd>Optional, defaults to false.
- When the application exits, any exit code other than 0 is considered a crash and the application will be started again.
- </dd>
- </dl>
- <dl>
- <dt><icon></dt>
- <dd>Application icon in ICO format. May contain multiple color depths/resolutions.</dd>
- </dl>
- <dl>
- <dt><obj></dt>
- <dd>Optional, custom headers only. Ordered list of header object files.</dd>
- </dl>
- <dl>
- <dt><lib></dt>
- <dd>Optional, custom headers only. Ordered list of libraries used by header.</dd>
- </dl>
- <dl>
- <dt><singleInstance></dt>
- <dd>Optional, allow to run only a single instance of the application.</dd>
- </dl>
- <blockquote>
- <dl>
- <dt><mutexName></dt>
- <dd>Unique mutex name that will identify the application.</dd>
- <dt><windowTitle></dt>
- <dd>Optional, recognized by GUI header only. Title or title part of a window
- to bring up instead of running a new instance.
- </dd>
- </dl>
- </blockquote>
- <dl>
- <dt><jre></dt>
- <dd>Required element that groups JRE settings.</dd>
- </dl>
- <blockquote>
- <dl>
- <dt><path>, <minVersion>, <maxVersion></dt>
- <dd>The <em><path></em> property is used
- to specify absolute or relative JRE paths, it
- does not rely on the current directory or <em><chdir></em>.
- Note that this path is not checked until the actual application execution.<br />
- <strong class="warn">Launch4j 3.50</strong> <em><path></em> is now required and
- always used for searching before the registry in order to ensure compatibility
- with latest runtimes which by default do not add registry keys during installation.<br />
- <strong class="warn">Launch4j 3.50</strong> <em><minVersion></em> and <em><maxVersion></em>
- are now considered during path and registry search, previously the version was checked only
- during registry search. The first runtime version matching the given range will be used.
- </dd>
- </dl>
- <blockquote>
- <dl>
- <dt><path> alone</dt>
- <dd>Search for JREs using specified paths, if not found stop with error.<br /><br />
- Default: <path>%JAVA_HOME%;%PATH%</path><br />
- Bundled: <path>jre</path><br />
- Advanced: <path>%HKEY_LOCAL_MACHINE\SOFTWARE\UnusualJavaVendor\JavaHome%;%JAVA_HOME%;%PATH%</path>
- </dd>
- <dt><path> + <minVersion> [+ <maxVersion>]</dt>
- <dd>Use path search first, if Java cannot be located then perform a registry search.
- If that fails display an error message and optionally open the Java download page.
- </dd>
- </dl>
- </blockquote>
- </blockquote>
- <blockquote>
- <dl>
- <dt><minVersion>, <maxVersion> format - Java < 9</dt>
- <dd>The traditional version scheme supported by launch4j is 1.x.x[_xxx] and requires at least 3 parts, for example:
- <pre>
- 1.6.0
- 1.7.0_51
- 1.8.0_121
- </pre>
- </dd>
- </dl>
- </blockquote>
- <blockquote>
- <dl>
- <dt><minVersion>, <maxVersion> format - Java >= 9</dt>
- <dd>The new version format is xxx[.xxx[.xxx]] where only 1 part is required and the update version after the underscore is not allowed.
- <pre>
- 1.6
- 9
- 10.0.1
- </pre>
- </dd>
- </dl>
- </blockquote>
- <blockquote>
- <dl>
- <dt><requiresJdk></dt>
- <dd>Optional, defaults to false. When true only a JDK will be used for execution.<br />
- <strong class="warn">Launch4j 3.50</strong> An additional check will be performed if javac is available
- during path and registry search.
- </dd>
- </dl>
- </blockquote>
- <blockquote>
- <dl>
- <dt><requires64Bit></dt>
- <dd>Optional, defaults to false. True limits the runtimes to 64-Bit only, false will use
- 64-Bit or 32-Bit depending on which is found.<br />
- <strong class="warn">Launch4j 3.50</strong> This option works with path and registry search.
- </dd>
- </dl>
- </blockquote>
- <blockquote>
- <dl>
- <dt>HeapSize, HeapPercent</dt>
- <dd>If size and percent are specified, then the setting which yields
- more memory will be chosen at runtime. In other words, setting both values
- means: percent of available memory no less than size in MB.<br />
- <strong class="warn">Launch4j 3.50</strong> If the runtime is 32-Bit then a 32-Bit limit
- will be imposed even if more memory is available during path and registry search.
- </dd>
- </dl>
- <blockquote>
- <dl>
- <dt><initialHeapSize></dt>
- <dd>Optional, initial heap size in MB.</dd>
- </dl>
- <dl>
- <dt><initialHeapPercent></dt>
- <dd>Optional, initial heap size in % of available memory.</dd>
- </dl>
- <dl>
- <dt><maxHeapSize></dt>
- <dd>Optional, max heap size in MB.</dd>
- </dl>
- <dl>
- <dt><maxHeapPercent></dt>
- <dd>Optional, max heap size in % of available memory.</dd>
- </dl>
- </blockquote>
- <dl>
- <dt><opt></dt>
- <dd>Optional, accepts everything you would normally pass to
- java/javaw launcher: assertion options, system properties and X options.
- Here you can map environment and special variables <em>EXEDIR</em>
- (exe's runtime directory), <em>EXEFILE</em> (exe's runtime full file path)
- to system properties. All variable references must be surrounded with
- percentage signs and quoted.
- <pre>
- <opt>-Dlaunch4j.exedir="%EXEDIR%"</opt>
- <opt>-Dlaunch4j.exefile="%EXEFILE%"</opt>
- <opt>-Denv.path="%Path%"</opt>
- <opt>-Dsettings="%HomeDrive%%HomePath%\\settings.ini"</opt>
- </pre>
- </dd>
- </dl>
- </blockquote>
- <dl>
- <dt><splash></dt>
- <dd>Optional, groups the splash screen settings. Allowed only in GUI header.</dd>
- </dl>
- <blockquote>
- <dl>
- <dt><file></dt>
- <dd>Splash screen image in BMP format.</dd>
- </dl>
- <dl>
- <dt><waitForWindow></dt>
- <dd>Optional, defaults to true. Close the splash screen when an application
- window or Java error message box appears. If set to false,
- the splash screen will be closed on timeout.
- </dd>
- </dl>
- <dl>
- <dt><timeout></dt>
- <dd>Optional, defaults to 60. Number of seconds after which the splash screen
- must be closed. Splash timeout may cause an error depending on
- <em><timeoutErr></em>.
- </dd>
- </dl>
- <dl>
- <dt><timeoutErr></dt>
- <dd>Optional, defaults to true. True signals an error on splash timeout,
- false closes the splash screen quietly.
- </dd>
- </dl>
- </blockquote>
- <dl>
- <dt><versionInfo></dt>
- <dd>Optional, <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx">version information</a>
- to be displayed by the Windows Explorer.</dd>
- </dl>
- <blockquote>
- <dl>
- <dt><fileVersion></dt>
- <dd>Version number 'x.x.x.x'</dd>
- </dl>
- <dl>
- <dt><txtFileVersion></dt>
- <dd>Free form file version, for example '1.20.RC1'.</dd>
- </dl>
- <dl>
- <dt><fileDescription></dt>
- <dd>File description presented to the user.</dd>
- </dl>
- <dl>
- <dt><copyright></dt>
- <dd>Legal copyright.</dd>
- </dl>
- <dl>
- <dt><productVersion></dt>
- <dd>Version number 'x.x.x.x'</dd>
- </dl>
- <dl>
- <dt><txtProductVersion></dt>
- <dd>Free form file version, for example '1.20.RC1'.</dd>
- </dl>
- <dl>
- <dt><productName></dt>
- <dd>Text.</dd>
- </dl>
- <dl>
- <dt><companyName></dt>
- <dd>Optional text.</dd>
- </dl>
- <dl>
- <dt><internalName></dt>
- <dd>Internal name without extension, original filename or module name for example.</dd>
- </dl>
- <dl>
- <dt><originalFilename></dt>
- <dd>Original name of the file without the path. Allows to determine
- whether a file has been renamed by a user.
- </dd>
- </dl>
- <dl>
- <dt><trademarks></dt>
- <dd>Trademarks that apply to the file.</dd>
- </dl>
- <dl>
- <dt><language></dt>
- <dd>One of the language codes.</dd>
- </dl>
- </blockquote>
- <h3 id="Importing_1.x_configuration">Importing 1.x configuration</h3>
- 1.x configuration is no longer supported by launch4j 3.50. You can convert it to 3.14 and then to 3.50.
- <h3 id="Importing_3.x_configuration">Importing 2.x/3.x configuration to 3.50</h3>
- It's possible to import a 2.x/3.x configuration file using the GUI interface.
- Open the file, review all settings carefully as some of them cannot always
- be imported automatically and the search algorithm has changed in version 3.50.
- <h2 id="Ant_task">Ant task</h2>
- You may set a launch4j directory property or change the task definition.
- <pre><property name="launch4j.dir" location="/opt/launch4j" /></pre>
- Define the task in your Ant build script.
- <pre>
- <taskdef name="launch4j"
- classname="net.sf.launch4j.ant.Launch4jTask"
- classpath="${launch4j.dir}/launch4j.jar
- :${launch4j.dir}/lib/xstream.jar" />
- </pre>
- Execute the task!
- <pre><launch4j configFile="./l4j/demo.xml" /></pre>
- You can set or override the following configuration properties...
- <p class="attrib">
- jar="absolute path or relative to <em>basedir</em>"<br>
- jarPath="relative path"<br>
- outfile<br>
- fileVersion<br>
- txtFileVersion<br>
- productVersion<br>
- txtProductVersion<br>
- bindir="<a href="#Settings">alternate bin directory...</a>"<br>
- tmpdir="<a href="#Settings">alternate working directory...</a>"
- </p>
- <pre>
- <launch4j configFile="./l4j/demo.xml" outfile="mydemo.exe"
- fileVersion="1.0.0.0" txtFileVersion="1.0 RC2" />
- </pre>
- You can also define the entire configuration in the task, but it will
- not be possible to edit such a file in the GUI mode. All paths except
- for <em><chdir></em>, <em><jre><path></em> and <em>jarPath</em>
- are calculated using the <em>basedir</em> project attribute.
- <pre>
- <launch4j>
- <config headerType="gui" outfile="demo.exe"
- dontWrapJar="true" jarPath="demo.jar" >
- <var>SETTINGS="%HomeDrive%%HomePath%\\settings.ini"</var>
- <classPath mainClass="org.demo.DemoApp">
- <cp>./lib/looks.jar</cp>
- <cp>%USER_LIBS%/*.jar</cp>
- </classPath>
- <jre path="%JAVA_HOME%;%PATH%" minVersion="1.8.0">
- <opt>-Dlaunch4j.exedir="%EXEDIR%"</opt>
- <opt>-Dlaunch4j.exefile="%EXEFILE%"</opt>
- </jre>
- </config>
- </launch4j>
- </pre>
- <h2 id="Additional_jvm_options">Additional JVM options at runtime</h2>
- When you create a wrapper or launcher all configuration details are compiled into the
- executable and cannot be changed without recreating it or hacking with a resource editor.
- Launch4j 2.1.2 introduces a new feature that allows to pass additional JVM options
- at runtime from an .l4j.ini file. Now you can specify the options in the configuration file,
- ini file or in both, but you cannot override them. The ini file's name must correspond
- to the executable's <em>(myapp.exe : myapp.l4j.ini)</em>.
- The arguments should be separated with spaces or new lines, environment variable
- expansion is supported, for example:
- <pre>
- # Launch4j runtime config
- -Dswing.aatext=true
- -Dsomevar="%SOMEVAR%"
- -Xms16m
- </pre>
- <h2>Environemnt variables</h2>
- The following variables can be used in the configuration file (elements which contain %VAR%).
- They are substitued during runtime, so for example the EXEDIR is the directory where the user installed the wrapped application.
- <dl>
- <dt class="option">%VAR%</dt>
- <dd>
- Any environment variable, for example %HOMEPATH%.
- </dd>
- <dt class="option">%EXEDIR%</dt>
- <dd>
- Wrapper directory path.
- </dd>
-
- <dt class="option">%EXEFILE%</dt>
- <dd>
- Wrapper executable file path.
- </dd>
-
- <dt class="option">%PWD%</dt>
- <dd>
- Current directory, after chdir was applied.
- </dd>
-
- <dt class="option">%OLDPWD%</dt>
- <dd>
- Directory before chdir was applied.
- </dd>
-
- <dt class="option">%JREHOMEDIR%</dt>
- <dd>
- Path to the JRE which was selected for executing the application.
- </dd>
-
- <dt class="option">%HKEY_...\...%</dt>
- <dd>
- Registry key value, e.g.<br />
- %HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MemoryDiagnostic\LastScanTime%
- </dd>
- </dl>
- <h2 id="Runtime_options">Runtime options</h2>
- <dl>
- <dt class="option">--l4j-debug</dt>
- <dd>
- To make sure the output executable is configured correctly you can use the
- debug launching mode to log various information to the launch4j.log file.
- Environment variable can also be used...<br />
- SET Launch4j=debug
- </dd>
- <dt class="option">--l4j-debug-all</dt>
- <dd>
- Same as above, but additionally log loaded resources (options stored during wrapper creation).
- Environment variable can also be used...<br />
- SET Launch4j=debug-all
- </dd>
-
- <dt class="option">--l4j-dont-wait</dt>
- <dd>
- Disable the "stay alive" function.
- </dd>
- <dt class="option">--l4j-no-splash</dt>
- <dd>
- Disable the splash screen.
- </dd>
- <dt class="option">--l4j-no-splash-err</dt>
- <dd>
- Disable splash screen error on timeout, might be useful on very slow computers.
- </dd>
- </dl>
- <h2 id="Settings">Settings</h2>
- These settings are only used during building of the launcher or wrapper, not during their execution.
- <dl>
- <dt>Alternate bin directory: launch4j.bindir</dt>
- <dd>
- It's possible to override the default bin directory location which contains windres and ld
- tools using the <em>launch4j.bindir</em> system property. The property can have two forms:
- a path relative to Launch4j's directory (<em>altbin</em> for example) or an absolute path.
- <dd>
- <dt>Working directory: launch4j.tmpdir</dt>
- <dd>Change the working directory if the default path contains spaces which windres cannot handle.</dd>
- </dl>
- </div>
- <div class="footer">
- All trademarks mentioned are properties of their respective owners.<br />
- Copyright © 2005-2022 Grzegorz Kowal
- <p style="margin-top: 0.5em">
- <a href="https://sourceforge.net/p/launch4j/"><img alt="Download Launch4j Executable Wrapper" src="https://sourceforge.net/sflogo.php?type=17&group_id=95944" width=200></a>
- </p>
- </div>
- </div>
- </body>
- </html>
|