Hi folks, trying to pass command line arguments to...
# tornadofx
v
Hi folks, trying to pass command line arguments to my main class. But
launch<TornadoApplication>()
give compilation error, as if my TornadoApplication class was not of type javafx.application.Application, even when I extend the App super class. Any ideas on why is this happening? On OpenJDK 13
d
Copy code
fun main(args: Array<String>) {
 launch<MyApp>(args)
}
you mean this doesnt work? Did you specify a wrapping class ?
Copy code
class ApplicationRunner {
    companion object{
        @JvmStatic
        fun main(args: Array<String>) {
            MyApp().main(arrayOf())
        }
    }
}
v
I did,
I mean intellij can't find javafx.application.Application
it's not available anywhere on my classpath
I'm not a javafx developer, but seems that it was part of jfxrt and its not in any of the modules (javafx.*)
d
then you dependencies are not corrrect - the gradle i showed you should fix that problem - you can see in the gradle dependencies whether i was picked up or not
v
I'm sorry but my dependencies are exactly like your gradle (actually I've added more javafx modules)
d
your intellij is not building with gradle then? check your build settings
what does ./gradlw build tells you ?
./gradlew build
v
do you mind telling me which jar has javafx.appliaction.Application?
d
and you have to use gradle >= 6.0
for me Application is -> javafx-graphics-13.0.2-linux.jar
v
thank you, I had it set for 11, and it wasn't there. I went around the args limitation, but bumped into issues with module system of java 9 and certain dependencies 😞 Trying to go around this time by following some articles on bundling platform specific jars to a fatjar model
d
does
./gradlew build
works for you ?
i am still dodging the module system where i can, so i export to unnamed via the args in the gradle
@Vinicius Carvalho did you solve your problem?
v
I had to skip the module system
then it works
and for that I just created a empty MainClass that launches a main that inherits from the App type
because if the App type is the main class then we run into the issue of the modules trying to be loaded