Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8061333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:18:27+00:00 2026-06-05T10:18:27+00:00

In my code , I am facing apche library missing error.. I paste my

  • 0

In my code , I am facing apche library missing error..

I paste my whole code below..
pls help me to find the solution …

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.*;



// Apache POI - HSSF imports
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;




public class ExcelParser {

    HSSFSheet m_sheet;
    int m_iNbRows;
    int m_iCurrentRow = 0;
    private static final String JAVA_TOSTRING =
 "EEE MMM dd HH:mm:ss zzz yyyy";

    public ExcelParser(HSSFSheet sheet)
    {
        m_sheet = sheet;
        m_iNbRows = sheet.getPhysicalNumberOfRows();
    }


    /* Returns the contents of an Excel row in the 
form of a String array.
     * @see com.ibm.ccd.common.parsing.Parser#splitLine()
     */
    public String[] splitLine() throws Exception {
        if (m_iCurrentRow == m_iNbRows)
            return null;

        HSSFRow row = m_sheet.getRow(m_iCurrentRow);
        if(row == null)
        {
            return null;
        }
        else
        {
            int cellIndex = 0; 
            int noOfCells = row.getPhysicalNumberOfCells();
            String[] values = new String[noOfCells];        
            short firstCellNum = row.getFirstCellNum();
            short lastCellNum = row.getLastCellNum();

            if (firstCellNum >=0 && lastCellNum >=0) 
            {
                for(short iCurrent = firstCellNum; iCurrent <lastCellNum; iCurrent++) 
            {
                    HSSFCell cell = (HSSFCell)row.getCell(iCurrent);
                    if(cell == null)
                    {
                        values[iCurrent] = "";
                        cellIndex++;                
                        continue;
                    }
                    else
                    {
                        switch(cell.getCellType())
                        {                           
                        case HSSFCell.CELL_TYPE_NUMERIC:
                        double value = cell.getNumericCellValue();
                        if(HSSFDateUtil.isCellDateFormatted(cell)) 

                        {
                            if(HSSFDateUtil.isValidExcelDate(value))
                            {
                                Date date = HSSFDateUtil.getJavaDate(value);
                                SimpleDateFormat dateFormat = new SimpleDateFormat(JAVA_TOSTRING);  
                                values[iCurrent] = dateFormat.format(date);                             
                            }
                            else
                            {
                                throw new Exception("Invalid Date value found at row number " +
                                        row.getRowNum()+" and column number "+cell.getCellNum());   
                            }
                        }
                        else
                        {
                            values[iCurrent] = value + "";
                        }
                        break;

                        case HSSFCell.CELL_TYPE_STRING:
                            values[iCurrent] = cell.getStringCellValue();
                        break;

                        case HSSFCell.CELL_TYPE_BLANK:
                            values[iCurrent] = null;    
                        break;

                        default:
                            values[iCurrent] = null;    
                        }           
                    }                           
                }        
            }
            m_iCurrentRow++;
            return values;              
        }

    }

   public static void main(String args[])
   {
       HSSFWorkbook workBook = null; 
       File file  = new File("/home/sprasad/austin_api/Book1.xls");
       InputStream excelDocumentStream = null;
       try 
       {
           excelDocumentStream = new FileInputStream(file);
           POIFSFileSystem fsPOI = new POIFSFileSystem(new BufferedInputStream(excelDocumentStream));
           workBook = new HSSFWorkbook(fsPOI);         
           ExcelParser parser = new ExcelParser(workBook.getSheetAt(0));
           String [] res;
            while ((res = parser.splitLine()) != null)
            {
                            for (int i = 0; i < res.length; i++)
                {
                    System.out.println("Token Found [" + res[i] + "]");
                }
            }
            excelDocumentStream.close();

        }
        catch(Exception e)
        {
            e.printStackTrace();
        }


   }

above example facing error while I am using this code..

Please suggest me any library or tutorial for the same..
Thanks in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:18:28+00:00Added an answer on June 5, 2026 at 10:18 am

    Just download the Apache POI, inflate it on your classpath and check if it is working.

    If you are using eclipse, just right click on the project > Properties > Java Build Path > Libraries and click on add external JARs.

    Following JARs should be added:

    • poi-3.8-20120326.jar
    • poi-examples-3.8-20120326.jar
    • poi-excelant-3.8-20120326.jar
    • poi-ooxml-3.8-20120326.jar
    • poi-ooxml-schemas-3.8-20120326.jar
    • poi-scratchpad-3.8-20120326.jar

    After this, you should be able to use the project classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Brand new to android and facing a weird problem.Check out the code below FirstActivity.java:
I am currently facing an error in JavaScript. The code is given below function
I am facing error C2065: 'IOCTL_NDISUIO_OPEN_DEVICE' : undeclared identifier error in beneath code. Where
I didn't understand ..why I am facing this error.. Here is my code: package
The problem I am facing with below code is that whenever I try to
I have been facing an error when I trigger XSLT from a C# code,
I am facing an issue with SecureRandom in java. This was the code that
I'm trying to run the following code but unfortunately facing Error problems package jskypeexample;
I am facing this error my code is <a href='https://accounts.google.com/o/oauth2/auth? state=%2Fprofile&amp; client_id=524265562778.apps.googleusercontent.com& redirect_uri=https://localhost/oauth2callback.html& scope=https://gdata.youtube.com&
I am facing linker error with my code. I am trying to compile with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.