Your abc
folder is under src
and you're using absolute pathing with the leading /
which states it at the root of your file system.
Move the folder to the root folder of the project and then reference is as
File file = new File("abc/file.txt");
Assuming in linux you have this file in correct path: eg. /path/to/file/filename.txt
You can try this:
For windows:
File file = new File("\\path\\to\\file\\filename.txt");
For Linux:
File file = new File("/path/to/file/filename.txt");
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.