title: CellType cannot be resolved to a variable setCellType error Apache POI - Java
body: <p>I was reading the Apache poi guide: <a href="https://poi.apache.org/spreadsheet/quick-guide.html" rel="nofollow noreferrer">https://poi.apache.org/spreadsheet/quick-guide.html</a></p>
  
  <p>And I decided to follow along and type the code into my Eclipse project, and while writing the "Reading and Rewriting Workbooks" section, I got this error in eclipse: </p>
  
  <blockquote>
    <p>CellType cannot be resolved to a variable</p>
  </blockquote>
  
  <p>And I was wondering why? I found on another post in Stack Overflow to change this line: </p>
  
  <pre><code>cell.setCellType(CellType.STRING);
  </code></pre>
  
  <p>to: </p>
  
  <pre><code>cell.setCellType(HSSFCellType.STRING);//or XSSFCell
  </code></pre>
  
  <p>But it doesn't work, is there anything wrong with my code? (Which btw, I copied and pasted from apache's website)</p>
  
  <pre><code> InputStream inp = new FileInputStream("workbook.xls");
  
   Workbook wb = WorkbookFactory.create(inp);
   Sheet sheet = wb.getSheetAt(0);
   Row row = sheet.getRow(2);
   Cell cell = row.getCell(3);
   if (cell == null)
       cell = row.createCell(3);
   cell.setCellType(CellType.STRING);
   cell.setCellValue("a test");
  
   //Write 
   FileOutputStream fileOut = new FileOutputStream("workbook.xls");
   wb.write(fileOut);
   fileOut.close();
  </code></pre>