-2
我尝试使用相对路径访问我放置在src文件中的文件,但徒劳无功。
这里有一个例子:File file=new File("src/teledeclaration.xsd");
,但我得到了以下错误:
java.io.FileNotFoundException: /Users/macbookpro/Downloads/eclipse2
/Eclipse.app/Contents/MacOS/src/teledeclaration.xsd (No such file or directory)
为什么下面的路径,我已经写了“SRC/teledeclation.xsd”
正常路径之前出现/Users/macbookpro/Downloads/eclipse2/Eclipse.app/Contents/MacOS/
我该如何处理这个问题?
什么是您的项目的目录结构,以及您的项目位于磁盘上?我很难相信你的项目驻留在Eclipse.app目录 –
@BenGlasser我只有一个包“com.stage.service”,src> com> stage> service,我的类在服务文件夹上,我尝试要调用直接放在src 上的“teledeclaration”文件,我的项目位于[/ Users/macbookpro/Documents/workspace /] –