Problem using JavaFX Application class

Alan Bateman Alan.Bateman at oracle.com
Sat Feb 27 16:35:04 UTC 2016


On 25/02/2016 19:24, Sander Mak wrote:
> :
>
> One more follow-up question: when I remove the main() method that invokes launch (see here: https://bitbucket.org/sandermak/javafx-application/diff/src/applicationmodule/application/Main.java?diff2=fca74ffbc28d&at=without-main), the following error comes up (build 9-ea+106-jigsaw-nightly-h4498-20160221):
>
> Error: Main method not found in class application.Main, please define the main method as:
>     public static void main(String[] args)
> or a JavaFX application class must extend javafx.application.Application
>
> I hope Kevin or David can answer this but assuming this is output from `java -m` then it will be because that doesn't locate FX entry point (unlike `java -jar`). This may be something that needs to be fixed.
>
> It is indeed output from `java -m`, and can be reproduced by running `compilerun.sh` from the without-main branch of this Git repo: https://bitbucket.org/sandermak/javafx-application/src/fca74ffbc28d698b53fb38ed779971a41a5e371d/?at=without-main
>
Thanks for confirming. The issue is that `java -m` isn't setup to detect 
FX apps yet. When use `java -jar` to launch a FX app then it trampolines 
through the FX launcher and there isn't the equivalent for when the main 
class of the initial module is a javafx.application.Application.

-Alan


More information about the jigsaw-dev mailing list