edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
713 stars 110 forks source link

Can I pass JVM args to the application? #153

Closed dawidcxx closed 5 years ago

dawidcxx commented 5 years ago

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 5 years ago

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

serjant192 commented 5 years ago

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 5 years ago

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 :)

serjant192 commented 5 years ago

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

edvin commented 5 years ago

My pleasure :)

lxxxl123 commented 4 years ago

thank you very much