我正在开发一个 Eclipse 插件。在我的代码中,我通过 .java
打开一个 new File(filePath)
文件。但是,如果我提供从 /home
开始的绝对路径,插件才能找到该文件,否则我会得到 java.io.FileNotFoundException
。
该文件包含在 Binary Build
中的 Source Build
下的 Build
和 plugin.xml
中:
文件 (ReversePolishNotation.java
) 位于 testing
文件夹内的 /src
包中。
我希望插件从项目目录中找到文件。
这适用于不同文件夹中的另一个文件(但不适用于包中)。
我该怎么做?