I am having trouble with Scott Klements POI examples, specifically it can't find the HSSFWorkbook class.
Here's my classpath (i know it is short, but the class in question should be found at least)
                       Display Environment Var (*JOB)               
                                                                    
Name  . . . . . . . . . :   CLASSPATH                                
                                                                    
                                                                    
Value . . . . . . . . . :   '/java/poi-3.11/poi-3.11-20141221.jar'   
(I know there are a lot of things missing, but this one jar should contain the class I am looking for right now).
Here is the error:
                       Additional Message Information                        
                                                                             
Message ID . . . . . . :   RNQ0301       Severity . . . . . . . :   99        
Message type . . . . . :   Inquiry                                            
Date sent  . . . . . . :   06/26/15      Time sent  . . . . . . :   12:18:43  
                                                                             
Message . . . . :   Java exception received when calling Java method (C G D   
 F).                                                                         
Cause . . . . . :   RPG procedure XLCRTDEMO in program POI36/XLCRTDEMO        
 received Java exception "java.lang.NoClassDefFoundError:                    
 org.apache.poi.hssf.usermodel.HSSFWorkbook" when calling method "<init>"    
 with signature "()V" in class "org.apache.poi.hssf.usermodel.HSSFWorkbook". 
Recovery  . . . :   Contact the person responsible for program maintenance to 
 determine the cause of the problem.                                         
Possible choices for replying to message . . . . . . . . . . . . . . . :      
 D -- Obtain RPG formatted dump.                                             
 S -- Obtain system dump.                                                    
 G -- Continue processing at *GETIN.                                         
 C -- Cancel.                                                                
 F -- Obtain full formatted dump.                                            
Technical description . . . . . . . . :   If the exception indicates that the 
 Java class was not found, ensure the class for the method is in the class   
 path. If the exception indicates that the Java method was not found, check  
 the method name and signature. If the signature is not correct, change the  
 RPG prototype for the method, or change the Java method, so that the return 
 type and parameter types match. You can determine the signatures for all the
 methods in class XYZ using command QSH CMD('javap -s XYZ').                 
                                                                    
Class not found, but this is a partial listing of /java/poi-3.11/poi-3.11-20141221.jar:
  48842 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HSSFSheet.class                              
   8073 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.class         
   8574 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HSSFSimpleShape.class                        
   8258 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HSSFTextbox.class                            
   1623 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HSSFWorkbook$SheetRecordCollector.class      
  45991 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HSSFWorkbook.class             <<<<<              
   2622 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HeaderFooter$MarkupTag.class                 
   4946 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/usermodel/HeaderFooter.class                           
   3404 Wed Dec 17 01:02:58 EST 2014 org/apache/poi/hssf/usermodel/StaticFontMetrics.class                      
    729 Wed Dec 17 01:02:58 EST 2014 org/apache/poi/hssf/util/AreaReference.class                               
    656 Wed Dec 17 01:02:58 EST 2014 org/apache/poi/hssf/util/CellRangeAddress.class                            
   2030 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/util/CellRangeAddress8Bit.class                        
   1108 Wed Dec 17 01:02:58 EST 2014 org/apache/poi/hssf/util/CellRangeAddressList.class                        
    841 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/util/CellReference.class                               
   3248 Wed Dec 17 01:02:58 EST 2014 org/apache/poi/hssf/util/HSSFCellUtil.class                                
    845 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/util/HSSFColor$AQUA.class                              
   1013 Wed Dec 17 01:02:56 EST 2014 org/apache/poi/hssf/util/HSSFColor$AUTOMATIC.class                         
The class is obviously there.
I did the following in QShell, this is a partial list of environment variables
 OSTYPE=os400                                                     
 MACHTYPE=powerpc-ibm-os400                                       
 CLASSPATH=/java/poi-3.11/poi-3.11-20141221.jar       <<<< This is the whole classpath for this session
 TERMINAL_TYPE=5250                                               
 PATH=/usr/bin:.:/QOpenSys/usr/bin        
Yet I get the following error:
 $                                                                
javap -s org.apache.poi.hssf.usermodel.HSSFWorkbook              
 ERROR:Could not find org.apache.poi.hssf.usermodel.HSSFWorkbook  
and here is what that directory looks like:
 $                                                                
cd /java/poi-3.11                                                
 $                                                                
ls                                                               
 poi-3.11-20141221.jar                                            
 $
How do I coerce java to find the class? In qshell and RPG.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
As an Amazon Associate we earn from qualifying purchases.