Reputation: 18171
I have startup script in my Linux machine /etc/init.d/myscr
. Need to add some lines in it from inside of java application.
I do very simple file write routines, but have exception
java.io.FileNotFoundException: \etc\init.d\myscr (No such file or directory)
Looks like java doesn't sees my file. Why?
Upvotes: 0
Views: 104
Reputation: 5213
You should use File.separator
when constructing the file path. Also make sure you have permission to write to the file.
Upvotes: 1