简体   繁体   中英

Editing startup script from java

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?

You should use File.separator when constructing the file path. Also make sure you have permission to write to the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM