![](/img/trans.png)
[英]Eclipse is not showing “Run as Java Application” option. Only shows “Run Configurations”
[英]Eclipse not showing run as java application, only showing run configurations
这是我的代码。 还在建设中。 但只是想检查一下 syso 是否有效。
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);
}
}
当我尝试运行它时,我得到的唯一选项是“运行配置”。 为什么我没有作为 Java 应用程序选项运行? 我不知道如何选择运行时配置。
有人可以帮忙吗?
方法签名不正确:您提到:
public void main (String[] args) throws IOException
应该是:
public static void main (String[] args) throws IOException
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.