I am not a Mac user, but as far as I know, your path should be /Users/michealrichards/...
. You could also use the Java system property user.home
to get the home directory of the current user, independent of the platform:
String path = System.getProperty("user.home") + "/NetBeansProjects/UniProject/src";
Edit: I just noticed that you are trying to open a directory (src
) as a file! This won't work anyway. You have to pass a path to a file to the FileWriter
constructor.