2016-04-28 14 views
0

これは私のコードです。 まだビルドしています。 しかし、sysoが機能するかどうかを確認したいだけでした。EclipseがJavaアプリケーションとして実行されて表示されず、実行コンフィギュレーションのみが表示されます

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アプリケーションオプションとして実行されていないのですか? 実行時設定を選択する方法がわかりません。

誰かが助けることができますか?

答えて

1

メソッドの署名が正しくありません。 あなたが言及:

public void main (String[] args) throws IOException 

それは次のようになります。

public static void main (String[] args) throws IOException 
関連する問題