Note that there are some explanatory texts on larger screens.

plurals
  1. POImporting Jars not working
    primarykey
    data
    text
    <p>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.</p> <p>I have a file called Promomon.java</p> <pre><code>class Promomon { public static void main(String[] args) { System.out.println("Hello World!"); } } </code></pre> <p>Simple simple, everything is fine there. I can compile and run and I see Hello World!.</p> <p>Now I add the classes that I wish to use.</p> <pre><code>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; </code></pre> <p>That was taken straight from the Apache POI docs.</p> <ul> <li>I am using Ubuntu 10.04. I installed java using synaptic (apt-get install openjdk-6-jdk) </li> <li>Java is installed at /usr/lib/jvm/java-6-openjdk/jre/ </li> <li><p>JAVA_HOME is set to "/usr/lib/jvm/java-6-openjdk/jre/" </p> <p>$ echo $JAVA_HOME<br> /usr/lib/jvm/java-6-openjdk/jre/ </p></li> <li><p>I built POI jars myself using Ant, no problem there.</p></li> <li><p>I placed the jars into java's lib directory. (/usr/lib/jvm/java-6-openjdk/jre/lib/)</p> <p>$ ls -l /usr/lib/jvm/java-6-openjdk/jre/lib/poi*<br> -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<br> -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<br> -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<br> -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<br> -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<br> -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.jar </p></li> <li><p>My classpath is set to this directory. </p> <p>$ echo $CLASSPATH<br> /usr/lib/jvm/java-6-openjdk/jre/lib/ </p></li> </ul> <p>What on earth am I doing wrong? I also tried using the pre-built binaries, no change.</p> <p>Thanks for you help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload