ClassNotFoundException in eclipse

2019-09-25 10:34发布

问题:

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public void ReadXL(String Path) throws Exception
    {
        FileInputStream myStream=null;

    System.out.println("InReadxl");
    File xlFile = new File(Path);

  myStream = new FileInputStream(xlFile);
    HSSFWorkbook myWB = new HSSFWorkbook(myStream);

...........................

}

HSSFWorkbook myWB = new HSSFWorkbook(myStream); is creating **ClassNotFoundException**() after adding external jar file "poi-3.7-20101029". What might be causing the problem? Please, let me know the solution of this problem.

回答1:

Have you got all the required Jars on the runtime & build tabs of your plugin.xml?



回答2:

Clean your project and try again. Maybe a Eclipse issue.

Have you tried to use that on another project? Are you sure about the error stack trace. Maybe the ClassNotFound Exception is caused by another internal error.