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.
How can I do this?
I have tried BufferedWriter
and PrintWriter
but no effect. I tried usingFileOutputStream
but I cannot construct it using getClass().getResourceAsStream(path)
as it returns an InputStream
.