0

If it possible to build java desktop application with embedded JVM? I do not need to depend on the end user having the right JRE installed.

I build my application for Windows with l4j maven plugin. Googling does not give needed results. Maybe you someone know how to do it with maven o gradle, not by some another utility like Avian, ProGuard and etc. (Embed a JRE in a Windows executable?)

Eugene Ustimenko
  • 322
  • 4
  • 16
  • Did'nt quite get exactly what you want to achieve here?? – Akshay May 23 '17 at 10:55
  • See here for IZPack usage about this (Mavenizable) https://stackoverflow.com/questions/12144096/embedding-a-jre-into-winrun4j-only-once-for-installer-and-application – Tome May 23 '17 at 11:15

1 Answers1

0

The Maven plugin for Launch4j lets you generate the Launch4j executable as part of the Maven build process. It supports Maven 2.0.4 and Launch4j 3.x.

See here

This is a sample of the configuration that you can try to use:

    <plugin>
    <groupId>com.akathist.maven.plugins.launch4j</groupId>
    <artifactId>launch4j-maven-plugin</artifactId>
    <executions>
                ...
        <configuration>
                    ...
            <jre>
                <!-- Specify path or minVersion or both. -->
                <path>bundled JRE path (%VAR%)</path>
                <bundledJre64Bit>true|false</bundledJre64Bit>
                <bundledJreAsFallback>true|false</bundledJreAsFallback>
                <minVersion>x.x.x[_xx]</minVersion>
                <maxVersion>x.x.x[_xx]</maxVersion>
                <jdkPreference>jreOnly|preferJre|preferJdk|jdkOnly</jdkPreference>
                <runtimeBits>64|64/32|32/64|32</runtimeBits>
                <!-- Heap sizes in MB and % of available memory. -->
                <initialHeapSize>MB</initialHeapSize>
                <initialHeapPercent>%</initialHeapPercent>
                <maxHeapSize>MB</maxHeapSize>
                <maxHeapPercent>%</maxHeapPercent>
                <opt>text (%VAR%)</opt>
            </jre>
                    ...
        </configuration>
    </execution>
</executions>
</plugin>
Mike Adamenko
  • 2,944
  • 1
  • 15
  • 28