Programmers learn & share
0 votes

Problem :

I am getting following error while trying to execute JavaFX code

javafx application class must extend javafx.application.application

by (6.9k points)  
edited by | 571 views

1 Answer

0 votes

Solution :

I think you do not have a main method in your class as the error suggests. 

Please replace the static with bellow syntax

PFB Syntax for main() in Java

public static void main(String[] args) 



and it works fine for me. 

Also please note it is not possible to run a Java program without main method so you are getting the error.

Further Readings:

by (36.1k points)  
edited by
2,183 questions
2,486 answers
241 users