title: Can't run JavaFX - Kotlin app
body: <p>I can't run my javafx - kotlin app.</p>
  
  <p>My Starter class</p>
  
  <pre><code>class Starter : Application() {
  
    override fun start(primaryStage: Stage?) {
        val root : Parent = FXMLLoader.load(javaClass.getResource("view/main.fxml"))
        primaryStage?.title = "Title"
        primaryStage?.scene = Scene(root)
        primaryStage?.show()
    }
  
    fun main(args: Array&lt;String&gt;) {
        launch(args)
    }
  }
  </code></pre>
  
  <p>I can't pass the param "args" to "launch" method because compiler says:</p>
  
  <blockquote>
    <p>Error:(19, 9) Kotlin: None of the following functions can be called
    with the arguments supplied:  public open fun launch(p0: Class!, vararg p1: String!): Unit defined in
    javafx.application.Application public open fun launch(vararg p0:
    String!): Unit defined in javafx.application.Application</p>
  </blockquote>
  
  <p>If I trying call "launch" method without params I have following Exception</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)     at
    sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
    Caused by: java.lang.NullPointerException     at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)     at
    com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
      at
    com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
      ... 5 more</p>
  </blockquote>