My dilemma is i am wanting to write an arraylist to a specific folder within the package mounted in Netbeans. My only problem is I am running on a mac and cannot get to write to correct place. I have tried to use /.../file name etc. It works if i explicitly give the whole path but i do not want to do this as this app will need to transportable to other machines. Any help please.
Try using the System.getProperty() method. the "user.home" property will point to the user's Home directory, no matter what platform you're running. A lot of Java programs just use that directory for data files.
I tried you suggestion and it works good for getting to the users home folder but I am wanting to contain the resource data file all within the same package. ie... Folder contains all .java files and any resource folders needed. I can get the resource just fine using getClass().getResourceAsStream() but when i write out i get errors. I am using
Is there something like the getClass... that mimics writing out to files. I am also using a mac and only plan on distributing this to other macs only.