Properties init: Could not determine current working directory.

David Gibbs via JAVA400-L <[email protected]> Fri, 9 Jan 2026 10:27:40 -0600
Newsgroups gmane.comp.lang.as400.java
Message-ID <CAEStNX=0VaOsbkcGtfxfZxPJ0KGs3oP-4+6kzFdvBYwV-jSDSg@mail.gmail.com>
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)

 at java/lang/System.afterClinitInitialization (java.base@11/System.java:220)

 at java/lang/Thread.initialize (java.base@11/Thread.java:375)

 at java/lang/Thread.<init> (java.base@11/Thread.java:162)

Unable to create Java Virtual Machine.


Anyone know where the current working directory for a job would be set?  Is
it a job description setting (I couldn't find anything there)?  Subsystem
description?  User profile?

The user profile DOES have a home directory set, but that directory doesn't
exist.  However, the same is true for our development system.

Any ideas where to look next?

Thanks!

david
-- 
IBM i on Power Systems: For when you can't afford to be out of business!
-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.