Has Ventura changed how CWD is set when executing a jar file?

Six years ago I wrote a Java App that assumed (possibly incorrectly) that the current working directory for the JVM would be set to the directory containing the jar file. So when I installed the app I put it into a new directory under documents. This has worked fine on Windows and MacOS through a number of system upgrades until Ventura where suddendly the app failed because it was unable to locate its database. After much thrashing around I discovered accidentally that if I moved the directory containing the jar file to some location other than under documents or desktop, it resumed normal execution.


I haven't tested all the subdirectories under my home directory other than documents and desktop. What I did was simply add a new subdirectory to my home directory. I should also say that I upgraded the jre to the latest one, but that did not solve the problem.

MacBook Air Apple Silicon

Posted on Nov 7, 2022 1:21 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 9, 2022 3:26 PM

The answer is that apparently it is a Java problem, not a MacOS problem (sorry Apple). I tested it on my other Mac which was running 12.6.1 Monterey using a JRE 151 which was about 4 years old. The problem did not occur and the app started normally. Then I upgraded to the newest JRE changing nothing else and now it doesn't run from Desktop or Documents.


Egg on my face!

Similar questions

1 reply
Question marked as Top-ranking reply

Nov 9, 2022 3:26 PM in response to DonVining

The answer is that apparently it is a Java problem, not a MacOS problem (sorry Apple). I tested it on my other Mac which was running 12.6.1 Monterey using a JRE 151 which was about 4 years old. The problem did not occur and the app started normally. Then I upgraded to the newest JRE changing nothing else and now it doesn't run from Desktop or Documents.


Egg on my face!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Has Ventura changed how CWD is set when executing a jar file?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.