My Test annotation not working, eclipse is asking for main method

I have trying selenium code with @Test, but eclipse is not running it and asking for Main method. I’ve added Maven Project and added Selenium & TestNG dependencies to pom.xml Please help with the issue I’m facing Sample code:

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

public class BaseTest {
    @Test
    public void openBrowser() {
        File file = new File("./src/test/resources/config.properties");
      
    FileInputStream fileInput = null;
    try {
        fileInput = new FileInputStream(file);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
        System.out.println("File not found");
    }
    Properties prop = new Properties();
    
    //load properties file
    try {
        prop.load(fileInput);
    } catch (IOException e) {
        e.printStackTrace();
        System.out.println("Values not found");
    }
    System.setProperty("webdriver.chrome.driver","./src/test/resources/drivers/chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.get(prop.getProperty("baseURL"));
}

}

On running it,I’m facing

Error: Main method not found in class com.digivalsolutions.digiassess.LoginTest, please define the main method as:
   public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

My pom.xml file:

 <dependencies>
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.141.59</version>
</dependency>
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>7.3.0</version>
    <scope>test</scope>
</dependency>

Answer

I think you should install TestNG for your IDE. You can check this link for more details.