What about setting the class path and home dir env variables before calling your RPG code ?

That's usually what I've done, but I generally don't advocate calling Java from RPG.

We had problems several years back at RJS and abandoned calling Java from RPG.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

-----Original Message-----
Folks:

I've got some java code, being invoked from RPG, that is failing in
production.

The same code, running on our development system. Both systems are 7.4 and
have the same java 11 version installed.

The RPG code sets the classpath & java_home env variables (using java 11).

The job is receiving a MCH74A5 with reason code 2. This indicates that the
program ran System.exit with a non-zero exit code.

My code does not use System.exit.

The error occurs when the RPG code is invoking the java classes
constructor, which does absolutely nothing (empty constructor).

At the same time that this failure happens, a QPRINT spool file is created
for the user that contains this:

Exception in thread "main" java/lang/Error: Properties init: Could not
determine current working directory.
at java/lang/System.initProperties (java.base@11/NativeMethod:4294967295)

at java/lang/System.ensureProperties (java.base@11/System.java:417)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

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