How to use PrintWriter and File classes in Java?
If the directory doesn’t exist you need to create it. Java won’t create it by itself since the File class is just a link to an entity that can also not exist at all. As you stated the error is that the file cannot be created. If you read the documentation of PrintWriter constructor you can see … Read more