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

Cannot launch JavaFX application from command line using pkg/ClassName syxtax

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 8.1

      A DESCRIPTION OF THE PROBLEM :
      When I try to execute a JavaFX application in a package from command line it doesn't work and it shows an error, "Error: Could not find or load main class pack.App.java" I used this command to execute the java class file :
      java pack/App
      But it doesn't work and it produced the above stated error.

      REGRESSION. Last worked in version 8u91

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Step 1 : Make a JavaFX program inside a package
      Step 2 : Compile and run that program using Command Line (CMD in Windows)
      Step 3 : Use this command : java pack/App

      Note: It works for all other applications other than JavaFX

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      JavaFX Stage.
      ACTUAL -
      Error: Could not find or load main class pack.App.java

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Error: Could not find or load main class pack.App.java

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      This problem is with every JavaFX Application.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I solved this problem using : java pack.App

      (Why is it not working with: java package/classname ?? As it works with every other Java program except JavaFX.

      I think you should add this functionality as well to access it using package/classname. I found a solution by replacing the forward slash '/' with dot (.) and it worked.
      Thanks !

      SUPPORT :
      YES

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: