Java IO: Resource file getting modified in IDE but not in jar : <p>I am successfully able to read and write to a file in eclipse. I am also able to read from a file in the jar. However, I am not able to write to the file in the jar. It is located in a class folder called res. I have also unzipped the jar file and it contains the file I need to write to but it is not modified after the first run.</p>

<p>How can I do this?</p>

<p>I have tried <code>BufferedWriter</code> and <code>PrintWriter</code> but no effect. I tried using<code>FileOutputStream</code> but I cannot construct it using <code>getClass().getResourceAsStream(path)</code> as it returns an <code>InputStream</code>.</p>
