Java Launch4j

I'm using java 13: onyr ★ kenzae launch4j java -version java 13.0.2 2020-01-14 Java(TM) SE Runtime Environment (build 13.0.2+8) Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing) I'm running out of ideas. What should I do? Thank and take care, Onyr. Because of this, the registry location for the Java Runtime Environment is HKLM Software Wow6432Nod JavaSoft, not HKLM Software JavaSoft as it would be for 64 bit java installed on a 64 bit machine. Maybe launch4j only checks HKLM Software JavaSoft for the current version of java installed? Java download page; Download Launch4J and use the GUI to create the windows/Java exe file. Launc4J creates an XML file to save the configuration. I have specified the output file, this is the name of the exe file to be created. Jar is the input file which we want to bundle as an exe file. Lets use the Java JAR which we created in the previous step. Launch4j is an all-Java program that will bind a configurable Windows stub executable file to a Java jar file. The result is a jar embedded in a specially configured EXE.

Launch4j Maven Plugin

Originally hosted at http://9stmaryrd.com/tools/launch4j-maven-plugin/

Documentation

Java Launch4j

Please check [this](src/main/resources/README.adoc) document for more detailed info on how to use the plugin. Please also check Launch4j's Configuration file page.

Version Notes

Version notes 1.7.25

  • creates parent directories of an obj file, see [#99](../../pull/99)

Version notes 1.7.24

  • adds a threadSafe flag to the Mojo to properly mark that the plugin is thread safe, see [#72](../../issues/72)

Version notes 1.7.23

  • adds a parallelExecution flag that will allow to run only one instance of the plugin in the given time, see [#72](../../issues/72)

Version notes 1.7.22

  • upgrades to Launch4j version 3.12, see [#75](../../issues/75)

Version notes 1.7.21

  • fixes issue with detecting OSX, see [#58](../../issues/58)

Version notes 1.7.20

  • uses the linux64 platform when run on 64-bit Linux, see [#59](../../pull/59)

Version notes 1.7.19

  • upgrades to the version 3.11 of Launch4j

Version notes 1.7.18

  • reverts changes introduced in 1.7.17, see [#55](../../pull/55)

Version notes 1.7.17

  • adds support for unwrapped jar, see [#55](../../pull/55)

Version notes 1.7.16

  • detects different OSX versions to properly use proper binary bundle, see [#54](../../pull/54)

Version notes 1.7.15

  • allows override some properties loaded from an external Launch4j config file, see [#49](../../issues/49)

Version notes 1.7.14

  • fixes issue with setting language, see [#50](../../issues/50)

Version notes 1.7.13

  • upgrades maven plugins to latest versions, see [#47](../../issues/47)

Version notes 1.7.12

  • adds support for missing options, see [#45](../../issues/45)
    • language - please use one of the values as defined for the <language/> tag
    • trademarks - a free text used as a trademarks

Version notes 1.7.11

  • upgrades to Launch4j version 3.9

Version notes 1.7.10

  • fixes broken <configuration/> when not using <infile/>

Version notes 1.7.9

  • adds capability of loading Launch4j native configuration filexml<configuration> <infile>${project.basedir}/src/main/resources/my-app-config.xml</infile></configuration>By default it will take from ${project.basedir}/src/main/resources/${project.artifactId}-launch4j.xml.Plugin execution goal should be set to install. It's an optional configuration, you can either use your existing configuration as it was in previous version or use native Launch4jconfig file via <infile>.

Version notes 1.7.8

Java Launch4j Install

  • fixes issue with spaces in path to maven repository on non-Windows systems, see [#27](../../issues/27), [#28](../../issues/28)

Version notes 1.7.7

  • once again fixes problem with including dependencies in scope runtime (now it should be the final solution), see [#5](../../issues/5)
  • adds support for bundledJreAsFallback and bundledJre64Bit properties, see [#23](../../issues/23)
  • upgrades Launch4j to 3.8.0, see [#21](../../issues/21)

Version notes 1.7.6

  • fixes again problem with including dependencies in scope runtime, see [#5](../../issues/5)

Version notes 1.7.5

  • allows add custom headers and libraries to working dir [#22](../../pull/22)

Version notes 1.7.4

  • fixes type in default value for outfile parameter [#17](../../pull/17)

Version notes 1.7.3

  • uses Maven annotation instead of JavaDoc parameters [#15](../../pull/15)
  • upgrades Maven plugins [#15](../../pull/15)
  • converts tabs to spaces [5b0619](../../commit/5b0619)

Version notes 1.7.2

  • adds support for restartOnCrash Launch4j's option [#14](../../pull/14)

Version notes 1.7.1

  • launch4j's abeille dependency was excluded [#11](../../pull/11)
  • versions of several plugins were updated [#11](../../pull/11)
  • tabs were converted to spaces [#11](../../pull/11)

Version notes 1.7

  • uses the latest version of Launch4j (3.5.0)
  • contains support for runtimeBits, see [#6](../../issues/6)
  • fixes problem with including dependencies in scope runtime, see [#5](../../issues/5)

Version notes 1.6

  • dropped Launch4j source and based on artifacts from Maven Central, see [#8](../../issues/8)
  • uses the latest version of Launch4j (3.4.0)
  • at least Java 1.7 is required

FAQ

Q: I cannot build my project because dsol-xml dependency is missing?

A: Add this repository to your ~/.m2/settings.xml

Q: Where can I find -SNAPSHOT builds?

A: Use the Sonatype OSS repo

Q: Can I use Launch4j on 64bit OS?

Launch4j

A: Yes but you will have to install these libs to avoid problems:

  • lib32z1
  • lib32ncurses5
  • lib32bz2-1.0 (has been ia32-libs in older Ubuntu versions)
  • zlib.i686
  • ncurses-libs.i686
  • bzip2-libs.i686

See [#4](../../issues/4) for more details.

Launch4j Java_home

I have Launch4J on my computer and it’s a great program. One of its features I’m interested in is the ability to bundle a JRE in the general .EXE file. However, I can’t find any documentation that describes how to go about doing this.

How do I bundle a JRE with the EXE? Plus, where do I get a compact, portable JRE to run? The download links on Oracle are for the installer packages.

Answers:

After some attempts i finally get a workaround to bundle the jre in my application:

I package my app as a zip file with the following folders inside:

In the xml file of launch4j i configure the jre like this:

The trick here is that the path is not to the java.exe file. The path to the jre is relative to the position of the .exe and it should point to one folder before the java.exe file

The jre folder i’m using is just a copy&paste from the jre folder installed on a windows system.

Answers:

The only way I could bundle a JRE was to use Launch4J and Inno Setup Compiler.

First, create a ‘jre6’ folder (for example) in the same directory as your output file (.exe).

Then copy the JRE from your system into your jre6 folder.

Then you open Launch4J and set the ‘Bundled JRE path’ – just type in: jre6 . Then click the Build button (obviously, after you’ve entered all the other parameters – but the only value you need to enter on the ‘JRE’ tab itself is the ‘Bundled JRE path’ value.)

Java Launch4j Interview

I would have expected that to work, but if move the .exe to a new location (so it is no longer co-located with your jre6 folder) you get the “This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted” error when you try to run the application…

I’ve been playing around with this all day and there was no way I could get Launch4J to include the JRE in the .exe file. Really poor in my opinion, as their documentation does not seem to allude to this issue at all.

So what I did to solve was to use Inno Setup Compiler. This app is used to wrap your .exe as a Windows Installer file. So I added a setting to ISC script that copies the JRE into the installer package. The line I added to the script (in the [Files] section) was:

…a bit of workaround, but it did the trick.

Repeat all the above steps, and you should be sorted.

Launch4j Java 13

ANSWER TAKEN FROM here..user1617737

Answers:

The jre can usually be found in your SDK folder. Yes the links online are installers, but once it installs, the JRE is now located on your local disk. Mine is located in

Java Launch4j Software

The parts that you don’t need from the JRE could probably be removed manually if you really wanted (I’m not sure whats available online).