How to write to files outside a jar?

alexmac05
alexmac05 used Ask the Experts™
on
I need to write to a file outside of a jar. I have an executable jar file with a main and i am using FileWriter.

i can see from this posting that it is possible:
http://forums.sun.com/thread.jspa?threadID=192016&tstart=131820

however, the posting doesn't explain how to do it. How do you do this?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Java Developer
Top Expert 2010
Commented:
FileWriter writer = new FileWriter(new File("/path/to/file.txt"));

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial