Skip to content
Advertisement

Java – Method is not creating file text file

I got this method for creating a log file:

JavaScript

but the file is not created, instead I get this error:

JavaScript

Whats the fix for this?

Advertisement

Answer

Try putting the email.log directly as a child of the project root folder and a peer of src.

project_root/src

project_root/email.log (your file)

This is probably happening because of the relative path usage on your code, maybe if you place the entire path instead, it could work too.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement