2
votes

I have upgraded to Catalina yesterday (10.15.1 (19B88)), and now my java projects are not working properly.

All the files that the application should generate are not being created: logs, csv files, content written with FileWrite(...).write(...), etc.

My spring boot projects should create multiple logs (it did on Mojave) and none of them are working after the upgrade. Also, when I programmatically create a file with FileWriter I get below exception:

Caused by: java.io.IOException: No such file or directory
        at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.8.0_212]
        at java.io.File.createNewFile(File.java:1012) ~[na:1.8.0_212]

I have tried multiple different things and still no luck. I tried:

  • Updating to latest version of java 8, 1.8.0_231.
  • Moved all path to point to my home directory /Users/fd
  • Since Catalina has a new volume and we have a lot of firmlinks, I also tried pointing to the absolute path /System/Volumes/Data/Users/fd

Have found this Oracle notes that states:

Changes introduced with macOS 10.15 (Catalina) cause certain Java applications to behave incorrectly. Therefore, we cannot certify any JDK version on macOS 10.15 yet. If you still want to install and test the JDK or JRE on macOS 10.15, then this document covers what you will experience as you install the JDK or JRE.

...but nothing is stated about the problem that no files can be created through java.

Does anyone know how to fix this issue?

1
According to this entry in the Oracle Bug Database the issue (readonly is always true) seems to be fixed but the fix is not yet released. So most likely, you have to wait for the next release... - deHaar

1 Answers

0
votes

After the new release of the JDK with update 232 everything is working now.

The version of JDK I used that is working fine is:

java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)

Regarding all the failing issues I had related to directories stored in the root, I was able to fix it by the synthetic link approach.

I had to create synthetic.conf file in /etc and created, with below content:

$cat /etc/synthetic.conf
myappdir    System/Volumes/Data/Users/federicop/myappdir

For more info about the synthetic (symbolic) links for Catalina you ca check man synthetic.conf