java.lang.NoClassDefFoundError: org/apache/log4j/Logger at org.apache.poi.hssf.usermodel.HSSFWorkbook.<clinit> (HSSFWorkbook.java:115) at com.qinteraction.Excel.AnotherExcel.main(AnotherExcel.java:24) Exception in thread "main" This error comes out when I run a simple program using HSSFWORKBOOK. import java.io.*; import org.apache.poi.hssf.usermodel.HSSFWorkbook; public class FirstExcelTest { public static void main(String[] args) { HSSFWorkbook wb = new HSSFWorkbook(); FileOutputStream fileOut=null; try { fileOut = new FileOutputStream("c:\\workbook.xls"); wb.write(fileOut); fileOut.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } } What's wrong with this code?? java.lang.NoClassDefFoundError: org/apache/log4j/Logger at org.apache.poi.hssf.usermodel.HSSFWorkbook.<clinit> (HSSFWorkbook.java:115) at com.qinteraction.Excel.AnotherExcel.main(AnotherExcel.java:24) Exception in thread "main"
Just get log4j from http://jakarta.apache.org/log4j and put it in your classpath. If you have got a source download, running the build will automatically download it for you. Sorry it took so long to respond, i thought it was a bigger issue than it is.