Reading .xls in java using Apache POI

  • Context: Java 
  • Thread starter Thread starter nkk2008
  • Start date Start date
  • Tags Tags
    apache Java Reading
Click For Summary
SUMMARY

The discussion focuses on using Apache POI to read .xls files in Java, specifically utilizing the HSSF package for handling Excel spreadsheets. The user seeks guidance on installing Apache POI binaries on Ubuntu 10.04 and integrating them into their Java program using Eclipse. Key points include the necessity of including relevant POI jars when packaging the application for distribution and understanding licensing requirements for redistribution. The user expresses a lack of experience in packaging Java applications beyond running them in an IDE.

PREREQUISITES
  • Basic knowledge of Java programming
  • Familiarity with Eclipse IDE
  • Understanding of Java Archive (JAR) files
  • Basic command line skills for Ubuntu
NEXT STEPS
  • Learn how to install Apache POI on Ubuntu 10.04
  • Explore the HSSF package documentation for Apache POI
  • Research how to create executable JAR files in Java
  • Understand licensing requirements for redistributing Apache POI
USEFUL FOR

Java developers, particularly those working with Excel file manipulation, and anyone looking to package Java applications for distribution across multiple systems.

nkk2008
Messages
32
Reaction score
0
I have been given the task to write a program that does some basic math and numerical integration on numbers. Those numbers are stored in a .xls file. I have looked online and have seen the Apache POI and whatnot, but I have some serious problems stemming from my total lack of knowledge:

How would I install the binaries at http://poi.apache.org/download.html ? I am running Ubuntu 10.04.

After installation, do I just use import and package to use them in the program? What exactly do I say? I only need HSSF. I use Eclipse, but may dabble in Netbeans, if that makes any difference.

Once I actually implement them, what if I need to package my program and use it on multiple computers? Would that be easy? I have no idea how to package a program for use (I know I have to make a .jar, but that is it), but that is a bridge to cross later. What I need to know is if it will be easy to use this API on other machines. Will the parts I import be packaged in the jar? Will the other computer (not the one used to develop the program) need to install the Apache POI?

As you can see, I am totally new at this. I am good at actually coding and the logical part of the process, but I am totally lost when it comes to actually doing anything with my code other than running it within my IDE. Any help would be appreciated.

Thanks
Nkk
 
Technology news on Phys.org
Without actually LOOKING at the downloads I would expect that the files contain java jars that have the classes described in the javadoc section of the pages you linked. You will need a gzip (or probably just zip) program to unzip and a tar program to install them someplace. There might even be instructions included if you poke deep enough.

As to using them, I would hope that there is some high level user doc, or at least example programs, included or on that site someplace. It looks like you might be interested in the "hssf" -- Horrible SpreadSheet Format -- package.

When you distribute your program you will need to include the relevant packages and jars from the POI project along with your own code and classes. You will have to look at the licensing requirements to see what you need to do to redistribute. It is possible to make "executable jars" that double-click-run on Windoze, but I forget the full process.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K