如何从Java项目中的相对路径读取文件?java.io.File找不到指定的路径
我有一个包含2个包的项目:
tkorg.idrs.core.searchengines
tkorg.idrs.core.searchengines
在包(2)中我有一个文本文件ListStopWords.txt
,在包(1)中我有一个类FileLoadder
。这是代码FileLoader
:
File file = new File("properties\\files\\ListStopWords.txt");
但有这个错误:
The system cannot find the path specified
你能解决一下吗?谢谢。
Smart猫小萌
慕少森
相关分类