javac: package org.apache.poi.hssf.usermodel does not exist

Max picture Max · Nov 17, 2010 · Viewed 23.2k times · Source

I have a program attempting to use classes from the jakarta-poi-3.0.2.jar in my /usr/share/java directory:

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
etc...

When I compile, I get a package org.apache.poi.hssf.usermodel does not exist error for each of the imports above.

I have /usr/share/java on my classpath. Am I missing anything else?

Answer

Thorbjørn Ravn Andersen picture Thorbjørn Ravn Andersen · Nov 17, 2010

/usr/share/java on the classpath does not bring in all jars in /usr/share/java.

Try putting /usr/share/java/jakarta-poi-3.0.2.jar in your classpath instead.