Hello fellow Gradlers,
I’ve got a pretty straight-forward build.gradle for a JavaFX-application:
apply plugin: 'java'
apply plugin: 'application'
sourceCompatibility = 1.8
mainClassName = 'SomeMainClass'
project.ext {
assetsDir = rootProject.project(':android').file('assets')
}
dependencies {
// Some dependencies
}
task runDebug(type: JavaExec) {
debug true
}
configure([run, runDebug]) {
classpath = sourceSets.main.runtimeClasspath
main = mainClassName
args "assetsDir=\"$assetsDir\""
}
When I try to execute :run from IntelliJ, the application starts as it would normally, but I can’t debug it out of the box. With :runDebug, I am able to attach a remote debugger and I am in fact able to debug the entry-point, but JavaFX starts the actual application in another thread which neither is debuggable, nor the console output from this thread gets displayed. Other than that, the application works just fine (well actually, it doesn’t, that’s why I need to debug).
I already made sure Gradle and the application run the same Java version (while IntelliJ uses its own distribution of Java which I don’t think is a problem).
Another weird thing is, when I execute gradle tasks from the IDE, I get the Configuration on demand is an incubating feature-Warning. It doesn’t appear if I execute tasks via command line and I don’t have a gradle.properties in the project in which configuration on demand could have been enabled, and my gradle.properties in my home/.gradle-folder only enables the daemon.
I have this problem for a few weeks now and it is really frustrating, since I am kinda stuck now with it. Of course, it worked before and it kept working for a long time. I didn’t make any significant changes to the gradle-files in that time, so it probably is a configuration-thing, but it also occurs on two different systems.
Any help is greatly appreciated. Thanks!