edvin/fxlauncher

Can I pass JVM args to the application?

dawidcxx opened this issue · 6 comments

I would like to use G1GC for my application. Can this be done with a non native launcher? I tried a line like this in my gradle (kts)

fxlauncher {
  applicationParameters = "-XX:+UseG1GC"
}

but sadly that didn't work.

edvin commented

Yes, since javapackager supports the jvmOptions=option parameter, you can configure that in the javapackagerOptions section :)

How to add this arguments for virtual keyboard:
-Dcom.sun.javafx.isEmbedded=true
-Dcom.sun.javafx.touch=true
-Dcom.sun.javafx.virtualKeyboard=javafx

fxlauncher { ... javapackagerOptions = ['-Dcom.sun.javafx.isEmbedded=true', '-Dcom.sun.javafx.touch=true', '-Dcom.sun.javafx.virtualKeyboard=javafx'] }
I tried with javapackagerOptions, but it doesn't work.

edvin commented

Have a look in the documentation for javapackager: https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javapackager.html

jvmOptions=option

Option to be passed to the JVM when the application is run. Any option that is valid for the java command can be used. To pass more than one option, use multiple instances of the -B option, as shown in the following example:

    -BjvmOptions=-Xmx128m -BjvmOptions=-Xms128m

That should do it :)

Thank you for your prompt reply. You saved me a lot of time.

edvin commented

My pleasure :)

thank you very much