• Register
Log In
0 votes

Problem :

I am getting following error while trying to execute JavaFX code

javafx application class must extend javafx.application.application

6.9k points
edited by

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:


36.1k points
edited by

Related questions

0 votes
1 answer 253 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 423 views
Problem : Currently I am having issues while figuring out why am I receiving below error "Local variables referenced from an inner class must be final or effectively final". My program is running the concurrent threads to sort the array of #'s and then trying to find the high ... myhigh) myhigh = numbers[myindex]; System.out.println(myhigh); } . . . . } Above block of code is producing the error.
asked Dec 25, 2019 alecxe 7.5k points
0 votes
1 answer 122 views
Problem : In my code have main method in it. The program compiles on jgrasp with no errors but it keeps giving me a message as bellow: "no main methods, applets, or Midlets found in file jgrasp"
asked Nov 1, 2019 peterlaw 6.9k points
1 vote
1 answer 19 views
Problem: I am very new to Java and all its concepts. I want to know what is the need of build-time dependency’s presence when any application is run ? I am struggling to get this information but I am unable to find much details about this concept. Please help me in getting all the details of the concept.
asked May 18 Martin K 6.6k points
0 votes
1 answer 129 views
Problem : I want to connect to the database made by MS Access using the Java, but I am unable to manage it. I am using the ODBC and I am facing below exception: “java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application”
asked Feb 4 jwilliam 3.9k points