• Register
0 votes
1.9k views

Problem :

I am getting following error while trying to execute JavaFX code

javafx application class must extend javafx.application.application

6 5 3
6,930 points

Please log in or register to answer this question.

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:

https://github.com/RaftLib/shm/issues/3

9 7 4
38,600 points

Related questions

0 votes
1 answer 21 views
21 views
Problem : I am getting following error while trying to execute JavaFX code: javafx application class must extend javafx.application.application
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 2 views
2 views
Problem: any ideas on what i need to do for this problem? Exception in thread "javafx application thread"
asked Apr 4 Rohit kr 15k points
0 votes
1 answer 6 views
6 views
Problem: Is there anyone to helo on > 'javafx application could not launch due to system configuration' ?
asked Mar 20 Samiur1 38.4k points
0 votes
1 answer 28 views
0 votes
1 answer 57 views
57 views
Do I need to install something else that contains this package? Thank you.
asked Feb 12 TeamScript 13.5k points
0 votes
1 answer 62 views
0 votes
1 answer 502 views
502 views
Problem : Everytime we compile the GUI , we get bellow error exception in thread "javafx application thread" java.lang.nullpointerexception
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
1 answer 3 views
3 views
Problem: As I previously stated in my question, I am having difficulty learning. Could someone help assist me in completing my project?
asked Apr 1 rakib1 51.3k points
0 votes
1 answer 7 views
7 views
can you extend more than one class in java ?
asked Mar 20 Samiur1 38.4k points
0 votes
1 answer 33 views
33 views
Problem: java.lang.noclassdeffounderror: javafx/application/application
asked Feb 24 Hira 2.2k points