Discussion:
Woes trying to compile a .java file with POI
Sierra Bravo
2009-08-18 17:21:19 UTC
Permalink
Dear all
I've been trying to get a .java file compiled with POI. Running Java 1.6 on
Jaunty, I've tried various combinations of the following (with all the three
jar files, both using the command line switch and the CLASSPATH environment
variable):

$ javac -classpath /home/s1b/xls/poi-3.2-FINAL-20081019.jar ReadXls.java

ReadXls.java:1: package org.apache.poi.xssf.usermodel does not exist
import org.apache.poi.xssf.usermodel.*;
^
ReadXls.java:2: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.*;
^
ReadXls.java:3: package org.apache.poi.ss.util does not exist
import org.apache.poi.ss.util.CellRangeAddress;
(And 13 more of not being able to locate the class files)

Thanks in advance...

s1b
--
View this message in context: http://www.nabble.com/Woes-trying-to-compile-a-.java-file-with-POI-tp25029537p25029537.html
Sent from the POI - User mailing list archive at Nabble.com.
David Fisher
2009-08-18 17:28:51 UTC
Permalink
Please see the component map on the main poi page: http://poi.apache.org/

Notice that for XSSF you ought to be using a 3.5beta.

Notice that additional jars are needed.

Here is the component map:
POIFS poi-version-yyyymmdd.jar poi
HPSF poi-version-yyyymmdd.jar poi
HSSF poi-version-yyyymmdd.jar poi
XSSF poi-ooxml-version-yyyymmdd.jar poi-ooxml since 3.5-beta4
HLSF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HWPF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HDGF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HPBF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HSMF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad

So you'll also need "poi-ooxml" and you might need "poi-scratchpad"

Regards,
Dave
Post by Sierra Bravo
Dear all
I've been trying to get a .java file compiled with POI. Running Java 1.6 on
Jaunty, I've tried various combinations of the following (with all the three
jar files, both using the command line switch and the CLASSPATH environment
$ javac -classpath /home/s1b/xls/poi-3.2-FINAL-20081019.jar
ReadXls.java
ReadXls.java:1: package org.apache.poi.xssf.usermodel does not exist
import org.apache.poi.xssf.usermodel.*;
^
ReadXls.java:2: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.*;
^
ReadXls.java:3: package org.apache.poi.ss.util does not exist
import org.apache.poi.ss.util.CellRangeAddress;
(And 13 more of not being able to locate the class files)
Thanks in advance...
s1b
--
View this message in context: http://www.nabble.com/Woes-trying-to-compile-a-.java-file-with-POI-tp25029537p25029537.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Sierra Bravo
2009-08-19 01:36:30 UTC
Permalink
Thanks Dave.

Unfortunately though, there doesn't seem to be any download links for the
OOXML link. Does this have to be downloaded from svn somewhere?

TIA

s1b
Post by David Fisher
Please see the component map on the main poi page: http://poi.apache.org/
Notice that for XSSF you ought to be using a 3.5beta.
Notice that additional jars are needed.
POIFS poi-version-yyyymmdd.jar poi
HPSF poi-version-yyyymmdd.jar poi
HSSF poi-version-yyyymmdd.jar poi
XSSF poi-ooxml-version-yyyymmdd.jar poi-ooxml since 3.5-beta4
HLSF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HWPF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HDGF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HPBF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HSMF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
So you'll also need "poi-ooxml" and you might need "poi-scratchpad"
Regards,
Dave
Post by Sierra Bravo
Dear all
I've been trying to get a .java file compiled with POI. Running Java 1.6 on
Jaunty, I've tried various combinations of the following (with all the three
jar files, both using the command line switch and the CLASSPATH environment
$ javac -classpath /home/s1b/xls/poi-3.2-FINAL-20081019.jar
ReadXls.java
ReadXls.java:1: package org.apache.poi.xssf.usermodel does not exist
import org.apache.poi.xssf.usermodel.*;
^
ReadXls.java:2: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.*;
^
ReadXls.java:3: package org.apache.poi.ss.util does not exist
import org.apache.poi.ss.util.CellRangeAddress;
(And 13 more of not being able to locate the class files)
Thanks in advance...
s1b
--
http://www.nabble.com/Woes-trying-to-compile-a-.java-file-with-POI-tp25029537p25029537.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/Woes-trying-to-compile-a-.java-file-with-POI-tp25029537p25036243.html
Sent from the POI - User mailing list archive at Nabble.com.
David Fisher
2009-08-19 04:55:57 UTC
Permalink
Nightly builds are here:

http://encore.torchbox.com/poi-svn-build/
Post by Sierra Bravo
Thanks Dave.
Unfortunately though, there doesn't seem to be any download links for the
OOXML link. Does this have to be downloaded from svn somewhere?
TIA
s1b
Post by David Fisher
Please see the component map on the main poi page: http://poi.apache.org/
Notice that for XSSF you ought to be using a 3.5beta.
Notice that additional jars are needed.
POIFS poi-version-yyyymmdd.jar poi
HPSF poi-version-yyyymmdd.jar poi
HSSF poi-version-yyyymmdd.jar poi
XSSF poi-ooxml-version-yyyymmdd.jar poi-ooxml since 3.5-beta4
HLSF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HWPF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HDGF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HPBF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
HSMF poi-scratchpad-version-yyyymmdd.jar poi-scratchpad
So you'll also need "poi-ooxml" and you might need "poi-scratchpad"
Regards,
Dave
Post by Sierra Bravo
Dear all
I've been trying to get a .java file compiled with POI. Running Java 1.6 on
Jaunty, I've tried various combinations of the following (with all the three
jar files, both using the command line switch and the CLASSPATH environment
$ javac -classpath /home/s1b/xls/poi-3.2-FINAL-20081019.jar
ReadXls.java
ReadXls.java:1: package org.apache.poi.xssf.usermodel does not exist
import org.apache.poi.xssf.usermodel.*;
^
ReadXls.java:2: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.*;
^
ReadXls.java:3: package org.apache.poi.ss.util does not exist
import org.apache.poi.ss.util.CellRangeAddress;
(And 13 more of not being able to locate the class files)
Thanks in advance...
s1b
--
http://www.nabble.com/Woes-trying-to-compile-a-.java-file-with-POI-tp25029537p25029537.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/Woes-trying-to-compile-a-.java-file-with-POI-tp25029537p25036243.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Sierra Bravo
2009-08-19 11:09:58 UTC
Permalink
Thanks again, Dave.

For those who want to get started off immediately, here is a quick-and-dirty
example. What the program does is to read the value of single-cell "Named
Range" from within an Excel file, and print it out. Pls be warned that it
does no error checking whatsoever. The syntax expected is:

$ ./compile ReadRange.java
$ ./run ReadRange MySheet.xls Location

The Java file: http://www.nabble.com/file/p25042073/ReadRange.java
ReadRange.java

The compile script: http://www.nabble.com/file/p25042073/compile compile

The run script: http://www.nabble.com/file/p25042073/run run

This has been tested on POI 3.5 running on Jaunty with Java 1.6 from Sun
(Java-6-Sun).

s1b
Post by David Fisher
http://encore.torchbox.com/poi-svn-build/
--
View this message in context: http://www.nabble.com/Woes-trying-to-compile-a-.java-file-with-POI-tp25029537p25042073.html
Sent from the POI - User mailing list archive at Nabble.com.
Loading...