This is really a limitation for Java on IBM i . It's not only for J9 but
also for Classic JVM on i. Is your application a new app with Java on i?
Or it worked someway before you move to J9?
For RPG calling Java, there is a workaround way to make your application
work is that you can using a java.endorsed.dirs property to include the
folders containing your JARs.


Wish it can work for you.

Best regards.

Gavin, Zhang Gan
IBM i J9 Dev,
Email: zhanggan@xxxxxxxxxx
Phone: +86-10-82452719
Address: 1/F, 28, ZhongGuanCun Software Park, No.8 Dong Bei Wang West
Road, Haidian District, Beijing P.R.China 100193

"Sonin,Nikolai" <nsonin@xxxxxxxxxxx>
Sent by: java400-l-bounces@xxxxxxxxxxxx
09/28/2012 12:13 AM
Please respond to
Java Programming on and around the IBM i <java400-l@xxxxxxxxxxxx>


J9 JVM not compliant?

To All:

I am trying to use the 32 bit J9 JVM that is 1.6 of java on V5R4M5 from
an ILE RPG program:

The following code:

D q s 1a inz('''')


Exec_Command('CHGCURDIR DIR(' + q + '/java/' + q + ')');


'VALUE(' +

q +

'.:/Java/*.jar:/Java/lib/*.jar:/Java/rpgmail.jar' +

q +



'VALUE('+ q + '/QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit'

+ q + ')');



P e

Is supposed to set the JAVA_HOME ENVVAR and the CLASSPATH ENVVAR for the
JVM before using the Java Mail API.

It does this:

CLASSPATH '.:/Java/*.jar:/Java/lib/*.jar:/Jav' >

JAVA_HOME '/QOpenSys/QIBM/ProdData/JavaVM/jdk' >

But this is what I get in the Job Log:

Message ID . . . . . . : RNX0301 Severity . . . . . . . : 50

Message type . . . . . : Escape

Date sent . . . . . . : 09/27/12 Time sent . . . . . . :

Message . . . . : Java exception received when calling Java method.

Cause . . . . . : RPG procedure RPGMAIL_NE in program

received Java exception "java.lang.NoClassDefFoundError:

when calling method "<init>" with signature "()V" in class


According to Oracle in Java 6 specifying the directory or *.jar in the
classpath is supposed search all of the jar files in the directory.
Obviously I am doing something wrong or IBM did not get the message.

What am I doing wrong?

Thanks in advance for your time and effort.

Nick Sonin

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2022 by 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.