fvarrui / JavaPackager

:package: Gradle/Maven plugin to package Java applications as native Windows, MacOS, or Linux executables and create installers for them.
GNU General Public License v3.0
1.07k stars 133 forks source link

--enable-preview argument to launch exe #388

Closed valimaties closed 10 months ago

valimaties commented 10 months ago

I'm submitting a…

Short description of the issue/suggestion: I'm using the latest Liberica JDK, which right now is v21, which uses the new Java SDK 21. However, to run the executable and uses the preview features I need to add --enable-preview argument on the compiler args. When running jar file I need also to run it with --enable-preview argument, like java --enable-preview -jar myJar.jar . Now, using this plugin to create the exe file from the jar file, and the installer as well, the exe file does not starts. Is there any way to add this --enable-preview argument to launch the jar file (exe file)?

Please tell us about your environment:

valimaties commented 10 months ago

Wow... I've done it, using

<vmArgs>
     --enable-preview
</vmArgs>

in configuration tag of plugin in pom file.

fvarrui commented 10 months ago

Hi @valimaties! So, do you think we can close this issue?

fvarrui commented 10 months ago

Oh! I prefer this way:

<vmArgs>
     <vmArg>--enable-preview</vmArg>
</vmArgs>

same result!