× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



CZE Midrange wrote:
>  I created a JAR with CRTJVAPGM with Classpath *ENVVAL
>
>  I set the jobs environment value of classpath to /poi.jar
>  (the jar resides in the root). Folder POI is in QDLS. 
>  Doc inside folder is MARC.JAR.
>
>  The rpg code looks like:
>
>  * // OBJECT  DEFINITIONS
>  * WORKBOOK
>
>  DWB             S              O   CLASS(*JAVA
>  D                                  'org.apache.poi.hssf.usermodel-
>  D                                      .HSSFWorkbook')
>   * WORKBOOK CONSTRUCTOR                
>  DCREATEWB       PR             O   EXTPROC(*JAVA   
>  D                                      :'org.apache.poi.hssf.usermodel-
>  D                                        .HSSFWorkbook'
>  D                                      :*CONSTRUCTOR)
>  D                                  CLASS(*JAVA
>  D                                     :'org.apache.poi.hssf.usermodel-
>  D                                         .HSSFWorkbook')
>   /FREE           
>         COUNT = 0;
>         // Create a Workbook.
>         
>         WB = CREATEWB();
> on the call to the Constructor the java.lang.NoClassDefFound error appears. 
> Any Ideas? 

Did you really set the "classpath" environment variable?  It should be
"CLASSPATH"; environment variables are case-sensitive.

But the real problem is that you're using the wrong continuation
character for your RPG literals.  The - continuation means "start at the
first available position"; the + continuation means "start at the first
non-blank".  So you're try to use class 
    'org.apache.poi.hssf.usermodel.       HSSFWorkbook'

(The error message should have shown what class it couldn't find.)

By the way, I find it useful to define a named constant, like
WorkbookClass, with a long class name.  Then you only have to code the
long form once.  Also, you don't need to code the CLASS keyword for a
constructor; the class of the return value is the same as the class of
the constructor.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.