Reputation: 21
This is my code. Still building it. But just wanted to check if the syso works.
package mySeleniumProjects;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class ReadExcelExample {
static WebDriver driver = new FirefoxDriver();
static String username;
static String passwd;
static String baseURL = "http://www.guru99.com";
int rowNum;
int colNum;
public void main (String[] args) throws IOException{
File excel = new File("Gave File path here");
FileInputStream fis = new FileInputStream(excel);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet ws = wb.getSheet("Sheet1");
rowNum = ws.getLastRowNum();
colNum = ws.getRow(0).getLastCellNum();
System.out.println(rowNum);
System.out.println(colNum);
}
}
When I try to run it the only option I am getting is "Run Configurations". Why I am not getting run as java application option? I don't know how to choose run time configuration.
Can somebody help?
Upvotes: 2
Views: 3079
Reputation: 1640
Write click on your java file. then on the next window search for 'java application', then click on 'New launch configuration' and select your java file and click on run. It will run your java program successfully.
Upvotes: 1
Reputation: 4123
Method signature is incorrect: You mentioned:
public void main (String[] args) throws IOException
It should be:
public static void main (String[] args) throws IOException
Upvotes: 1