Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Apache POI framework 3.17 version  (Read 7400 times)
Candy M.
Posts: 139


« on: October 26, 2018, 02:05:58 am »

Has anyone tried the Apache POI framework 3.17 version? Reuben, have you tried it?   I see that you are using a 3.10 version on github.   I want it to run with Java 7 so I downloaded the latest available  which is 3.17.

I've just started trying to get it to work.
I have a simple program.  I'm just trying to get the 4GL to find the classes.
Code
  1. IMPORT JAVA org.apache.poi.xssf.usermodel.XSSFWorkbook
  2.  
  3. MAIN
  4.  
  5.        DISPLAY "Hello world"
  6.  
  7. END MAIN
  8.  
  9.  

When I compile, I get this:
Code
  1. IMPORT JAVA org.apache.poi.xssf.usermodel.XSSFWorkbook
  2. | The symbol 'org.apache.poi.xssf.usermodel.XSSFWorkbook' does not represent a valid variable type.
  3. | See error number -6622.
  4.  
  5. MAIN
  6.  
  7.        DISPLAY "Hello world"
  8.  
  9. END MAIN
  10.  
  11.  

My CLASSPATH:
Code
  1. .:/users/genero/3.10.15/dev/lib/fgl.jar:/users/apache_poi/poi-3.17/poi-3.17.jar:/users/apache_poi/poi-3.17/poi-ooxml-3.17.jar:/users/apache_poi/poi-3.17/poi-ooxml-schemas-3.17.jar:/users/apache_poi/poi-3.17/ooxml-lib/xmlbeans-2.6.0.jar
  2.  
  3.  

Now I can compile this java program just fine:
Code
  1. import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  2. class Hello {
  3.        public static void main(String[] args) {
  4.                System.out.println("Hello");
  5.        }
  6. }
  7.  
  8.  

And I'm sure I have the right jar file:
Code
  1. $ jar tf poi-ooxml-3.17.jar |grep XSSFWorkbook
  2. Picked up JAVA_TOOL_OPTIONS: -Xss2m
  3. org/apache/poi/poifs/crypt/temp/SXSSFWorkbookWithCustomZipEntrySource.class
  4. org/apache/poi/xssf/streaming/SXSSFWorkbook$SheetIterator.class
  5. org/apache/poi/xssf/streaming/SXSSFWorkbook.class
  6. org/apache/poi/xssf/usermodel/XSSFWorkbook$1.class
  7. org/apache/poi/xssf/usermodel/XSSFWorkbook$SheetIterator.class
  8. org/apache/poi/xssf/usermodel/XSSFWorkbook.class
  9. org/apache/poi/xssf/usermodel/XSSFWorkbookType.class
  10.  
  11.  

If I use the HSSFWorkbook, it compiles fine.

We are using Centos 7.3.   Also, we had to set  export JAVA_TOOL_OPTIONS=-Xss2m  as there is a problem in Centos 7.3.

Are there only certain versions that work?

Thanks!
Candy

Candy M.
Posts: 139


« Reply #1 on: October 26, 2018, 08:10:02 pm »

I got it to work.   It needed these jar files in the CLASSPATH:

Code
  1. $FGLDIR/lib/fgl.jar
  2. $POI_HOME/poi-3.17.jar
  3. $POI_HOME/poi-ooxml-3.17.jar
  4. $POI_HOME/poi-ooxml-schemas-3.17.jar
  5. $POI_HOME/ooxml-lib/xmlbeans-2.6.0.jar
  6. $POI_HOME/lib/commons-collections4-4.1.jar
  7.  
I guess you could include all jar files in the CLASSPATH but I wanted the minimum.   Probably that can be figured out by looking at documentation of the classes and see its dependencies as well.

Candy
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines