My Java code writes or reads a file, but the file cannot be found. Where did it go ?
If you don't specify the absolute path for the file, then the JVM will use the value of the System property named
when reading or writing a file.
To get around this JVM issue, you have 3 options:
Use absolute paths for your files
append the value of the user.dir System property to the front of your filename
Set the user.dir System property to be what your code expects
NOTE: this option has the potential to break other code which may be relying on the value of that property (i.e. it may result in unexpected failures/behavior), so we don't really recommend it.