I am trying to write data to a text file on my Desktop using PrintWriter in Java, but the file is not appearing and it is throwing a FileNotFound Exception. However it works fine in a Mac environment when compiled and ran in the same fashion. At first, I thought it was because the file systems are different, so I gave it an absolute file path in the form of C:/Users/[username]/Desktop/[filename].txt but it still doesn't work. Here is the method I am writing:
Trying printing the value of pathFileName to the console to see what it looks like. I'm guessing that theTime.getTimeStamp() returns something that contains characters which are not valid for a Windows file name such colon characters used for hours:minutes:seconds .