javafx-gradle-plugin
javafx-gradle-plugin copied to clipboard
JVMArgs (and potentially other options) ignored when running via jfxRun
Hey @FibreFoX ,
Thanks for the help with the last issue, got it working, not a problem with your plugin. I am using JVMArgs like this:
jvmArgs = ["-agentlib:TakipiAgent"]
But it doesnt work.
If I run java -agentlib:TakipiAgent -jar project.jar
in prompt it works.
Can you check what will generated inside the .cfg
-file?
No, .cfg file has been created.
build/jfx/native/{appname}/app/
should contain it ....
When I run jfxNative it create .cfg and works well.
[JVMOptions]
-agentlib:TakipiAgent
But with jfxRun, it doesnt work.
:D i think i get it now ... this is not how that feature works ... that options are not appended while calling jfxRun
This is half bug and other half feature, because "jfxRun" was only ment as some "stupid shorthand" for running the application. Thanks for finding this ;) and using the plugin
Hi @marckaraujo , can you try to add your parameters to jfx.runJavaParameter
? That one is one string and ment for debugging (like jfxRun
is itself). I have thought about this, but I don't feel good about adding that lists to jfxRun, as the only purpose was to add a convenient way for executing. As the jvmArgs
are ment for the final result and native launcher, I don't feel good about this.
How do you think about this, and is runJavaParameter
sufficient for you?
Its doesnt work for me, because tapiki need to launch with jvmArgs since it will monitor the application and send crash logs, of course that the most critical part is when you send the application to real users, this feature just help for local debug. The software in question is https://www.overops.com/
Have you tried this configuration?
jfx{
// used for native launchers
jvmArgs = [
'-agentlib:TakipiAgent'
]
// used for development via jfxRun-task
runJavaParameter = '-agentlib:TakipiAgent'
}
I am not using this software anymore, so I cant make the test again, sorry. You can close if you want. Thanks anyway.
Possibly this should be a separate issue but I believe this underlying problem affects integration with IntelliJ IDEA.
When I tell IDEA to run with jfxRun
task with debugging it runs the task correctly, but the debugger does not attach and breakpoints are not hit. I reported this to Jetbrains, and they suggest it's because the jfxRun
task is ignoring JVM args passed through.
Is this likely? If so, it would be great to have a fix for this issue. Alternatively, can you suggest a way to debug JavaFX apps with your plugin and IDAE?
@MartinEden the task jfxRun
runs your application within its own java-process (I use ProcessBuilder for this), therefor I think this is a misunderstanding how the "debugging"-feature from your IDE is working.
The jfxRun
was ment as a shortcut for the CLI-call, nothing more. This means that any JVM-args have to be set via runJavaParameter
@MartinEden Have you find a way to pass JVM args when debugging with IDE using this gradle plugin? Seems that this doesnt work: https://stackoverflow.com/questions/25079244/how-to-pass-jvm-options-from-bootrun/26141841#26141841
I've forgotten some of what was going on for me here but: I think I thought that the only way to run a Kotlin JavaFX app from IDEA was using the Gradle task. I think I then later found a way to directly invoke the debugger on my code without having to use jfxRun
.