I am trying to run this class but I am getting an error that main method is not found although I have defined the public static void main (String [] args){}
This is my class file :
package jDBCLearn;
public class Main {
public static void main(String[] args) {
try {
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306", "root", "Ronitpandey123");
System.out.println("Connection Succesful");
} catch (SQLException e) {
e.printStackTrace();
}
}
}
This is the project explorer:
This is the error log :
Error: Main method not found in class jDBCLearn.Main, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
This is the run configuration:
This is the dependencies folder:
This is the source folder: