I'm trying to do something very simple. All I want to do at this moment is build a file that contains the appropriate classes.
I have a file called Promomon.java
class Promomon {
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Simple simple, everything is fine there. I can compile and run and I see Hello World!.
Now I add the classes that I wish to use.
import org.apache.poi.xssf.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
That was taken straight from the Apache POI docs.
- I am using Ubuntu 10.04. I installed java using synaptic (apt-get install openjdk-6-jdk)
- Java is installed at /usr/lib/jvm/java-6-openjdk/jre/
JAVA_HOME is set to "/usr/lib/jvm/java-6-openjdk/jre/"
$ echo $JAVA_HOME
/usr/lib/jvm/java-6-openjdk/jre/I built POI jars myself using Ant, no problem there.
I placed the jars into java's lib directory. (/usr/lib/jvm/java-6-openjdk/jre/lib/)
$ ls -l /usr/lib/jvm/java-6-openjdk/jre/lib/poi*
-rw-r--r-- 1 root root 1539296 2010-09-08 12:40 /usr/lib/jvm/java-6-openjdk/jre/lib/poi-3.6-20100908.jar
-rw-r--r-- 1 root root 69142 2010-09-08 12:40 /usr/lib/jvm/java-6-openjdk/jre/lib/poi-contrib-3.6-20100908.jar
-rw-r--r-- 1 root root 181907 2010-09-08 12:40 /usr/lib/jvm/java-6-openjdk/jre/lib/poi-examples-3.6-20100908.jar
-rw-r--r-- 1 root root 412788 2010-09-08 12:40 /usr/lib/jvm/java-6-openjdk/jre/lib/poi-ooxml-3.6-20100908.jar
-rw-r--r-- 1 root root 3774336 2010-09-08 12:40 /usr/lib/jvm/java-6-openjdk/jre/lib/poi-ooxml-schemas-3.6-20100908.jar
-rw-r--r-- 1 root root 795893 2010-09-08 12:40 /usr/lib/jvm/java-6-openjdk/jre/lib/poi-scratchpad-3.6-20100908.jarMy classpath is set to this directory.
$ echo $CLASSPATH
/usr/lib/jvm/java-6-openjdk/jre/lib/
What on earth am I doing wrong? I also tried using the pre-built binaries, no change.
Thanks for you help!