FileNotFoundException after exporting as .jar file

后端 未结 2 819
粉色の甜心
粉色の甜心 2021-01-06 17:17

I\'m using Eclipse and developing a java application where I use of a local file. The file is inside the project folder, in a subfolder, say \"mydata/myfile.txt\" When I run

2条回答
  •  情书的邮戳
    2021-01-06 17:45

    Maybe this will help you

    InputStream in=ClassLoader.getSystemResourceAsStream("your file");
    

提交回复
热议问题