Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8334909

Incorrect error message when trying to launch a JavaFX app with the JavaFX mod

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10
      Java 24

      A DESCRIPTION OF THE PROBLEM :
      The error message shown when trying to launch a JavaFX application on a plain JDK (24 here) is incorrect (in French at least):
      >>>
      Erreur : la méthode principale doit renvoyer une valeur de type void dans la classe {0},
      définissez la méthode principale comme suit :
         public static void main(String[] args)
      java.lang.Exception: Stack trace
              at java.base/java.lang.Thread.dumpStack(Thread.java:2148)
              at java.base/sun.launcher.LauncherHelper.abort(LauncherHelper.java:699)
              at java.base/sun.launcher.LauncherHelper$FXHelper.setFXLaunchParameters(LauncherHelper.java:1110)
              at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:748)
      <<<


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile the following with JavaFX but run on a JDK without the JavaFX modules




      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A descriptive message that says JavaFX could not be found
      ACTUAL -
      Erreur : la méthode principale doit renvoyer une valeur de type void dans la classe {0},
      définissez la méthode principale comme suit :
         public static void main(String[] args)


      ---------- BEGIN SOURCE ----------
      package test.mavenproject1;
      import javafx.application.Application;
      import javafx.stage.Stage;

      public class Mavenproject1 extends Application {
          public static void main(String[] args) {
              System.out.println("Hello World!");
          }

        @Override
        public void start(Stage stage) throws Exception
        {
          throw new UnsupportedOperationException("Not supported yet.");
        }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            adev Anupam Dev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: