4 Replies Latest reply: Apr 30, 2013 8:57 AM by lgringo RSS

    Run from sources with preloader


      I'm trying to run a javafx application using a "login preloader".
      My question is, how do I test everything without creating the final jars.
      Can I run a command (such as java -cp . app.my.Main) and show it works ?

        • 1. Re: Run from sources with preloader
          In addition to . also put jfxrt.jar on your classpath.

          For example, on my windows box, I can run a compiled javafx app from the command line without packinging it in a jar using the following command:
          java -cp .;"C:\Program Files\Java\jdk1.7.0_06\jre\lib\jfxrt.jar" app.my.Main
          In a future release of the jdk, it won't be necessary to add jfxrt.jar to the classpath, but for now (jdk7u6) it is.

          Note, that the above usage is probably only useful during development, for deployment of apps to users, you are better off having them appropriately packaged using the JavaFX packaging tools.
          • 2. Re: Run from sources with preloader
            Ok, this works for launching application, but the preloader does not show up ...

            My problem is testing my preloader.
            In fact i have 2 issues :
            - Starting the full application (application + preloader) (NetBeans 7.2 works fine, for it, but I want be able to test the program without NetBeans)
            - Is there a way to manually start the Preloader (for test purpose) and send change notification (event) to the preloader.
            • 3. Re: Run from sources with preloader
              Did you ever get this right ?
              • 4. Re: Run from sources with preloader
                Actually, using JavaFX 2.2, it's possible to use this code to start the application : com.sun.javafx.application.LauncherImpl.launchApplication(Main.class, Preloader.class, args); instead of Application.launch(args).
                Looks like JavaFX 8.0 use launchApplicationWithArgs ...