title: can not convert xlsx to csv using poi api
body: <p>I am trying to convert xlsx file to csv file using below code  </p>
  
  <pre><code>import java.io.*;
  import java.util.Iterator;
  import org.apache.poi.ss.usermodel.Cell;
  import org.apache.poi.ss.usermodel.Row;
  import org.apache.poi.xssf.usermodel.XSSFSheet;
  import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  
  public class XLStoCSVConvert {
  
       static void xlsx(File inputFile, File outputFile) {
              // For storing data into CSV files
              StringBuffer data = new StringBuffer();
  
              try {
                  FileOutputStream fos = new FileOutputStream(outputFile);
                  // Get the workbook object for XLSX file
                  System.out.println("working......1");
                  XSSFWorkbook wBook = new XSSFWorkbook(new FileInputStream(inputFile));
                  // Get first sheet from the workbook
                  System.out.println("working......2");
                  XSSFSheet sheet = wBook.getSheetAt(0);
                  Row row;
                  Cell cell;
                  // Iterate through each rows from first sheet
                  Iterator&lt;Row&gt; rowIterator = sheet.iterator();
  
                  while (rowIterator.hasNext()) {
                      row = rowIterator.next();
  
                      // For each row, iterate through each columns
                      Iterator&lt;Cell&gt; cellIterator = row.cellIterator();
                      while (cellIterator.hasNext()) {
  
                          cell = cellIterator.next();
  
                          switch (cell.getCellType()) {
                              case Cell.CELL_TYPE_BOOLEAN:
                                  data.append(cell.getBooleanCellValue() + ",");
  
                                  break;
                              case Cell.CELL_TYPE_NUMERIC:
                                  data.append(cell.getNumericCellValue() + ",");
  
                                  break;
                              case Cell.CELL_TYPE_STRING:
                                  data.append(cell.getStringCellValue() + ",");
                                  break;
  
                              case Cell.CELL_TYPE_BLANK:
                                  data.append("" + ",");
                                  break;
                              default:
                                  data.append(cell + ",");
  
                          }
                      }
                  }
  
                  fos.write(data.toString().getBytes());
                  fos.close();
  
              } catch (Exception ioe) {
                  ioe.printStackTrace();
              }
          }
  
      public static void main(String[] args) {
          File inputFile = new File("/home/raptorjd4/Desktop/ToConsult.xlsx");
          //writing excel data to csv 
          File outputFile = new File("/home/raptorjd4/Desktop/RaptorTrackingSystem/ToConsult.csv");
          xlsx(inputFile, outputFile);
  
      }
  
  }
  </code></pre>
  
  <p>But i am getting output,</p>
  
  <p>Working......1
  <code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/UnsupportedFileFormatException</code></p>
  
  <p>My jar in lib folder,</p>
  
  <p><strong>poi-3.5-FINAL.jar</strong></p>
  
  <p><strong>poi-ooxml-3.11.jar</strong></p>
  
  <p>why i am getting this error when i mapped all needed jar file in lib folder.</p>
  
  <p>Where am i doing mistake?</p>