Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVMArgs (and potentially other options) ignored when running via jfxRun #59

Open
marckaraujo opened this issue Mar 23, 2017 · 14 comments
Open

Comments

@marckaraujo
Copy link

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.

@FibreFoX
Copy link
Owner

Can you check what will generated inside the .cfg-file?

@marckaraujo
Copy link
Author

No, .cfg file has been created.

@FibreFoX
Copy link
Owner

build/jfx/native/{appname}/app/ should contain it ....

@marckaraujo
Copy link
Author

When I run jfxNative it create .cfg and works well.

[JVMOptions]
-agentlib:TakipiAgent

But with jfxRun, it doesnt work.

@FibreFoX
Copy link
Owner

:D i think i get it now ... this is not how that feature works ... that options are not appended while calling jfxRun

@FibreFoX
Copy link
Owner

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

@FibreFoX FibreFoX changed the title JVMArgs JVMArgs (and potentially other options) ignored when running via jfxRun Mar 23, 2017
@FibreFoX
Copy link
Owner

FibreFoX commented Apr 2, 2017

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?

@FibreFoX FibreFoX removed the bug label Apr 2, 2017
@marckaraujo
Copy link
Author

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/

@FibreFoX
Copy link
Owner

FibreFoX commented Apr 4, 2017

Have you tried this configuration?

jfx{
    // used for native launchers
    jvmArgs = [
        '-agentlib:TakipiAgent'
    ]
    // used for development via jfxRun-task
    runJavaParameter = '-agentlib:TakipiAgent'
}

@marckaraujo
Copy link
Author

I am not using this software anymore, so I cant make the test again, sorry. You can close if you want. Thanks anyway.

@MartinEden
Copy link

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?

@FibreFoX FibreFoX added this to the v9.0.0 milestone Aug 15, 2017
@FibreFoX
Copy link
Owner

@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

@mataide
Copy link

mataide commented Jan 6, 2018

@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

@MartinEden
Copy link

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.

@FibreFoX FibreFoX removed this from the v9.0.0 milestone Mar 30, 2018
@FibreFoX FibreFoX removed their assignment Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants