Variable references non-existent resource Build.xm

2019-02-22 00:33发布

I am using Eclipse Kepler and I am trying to execute my build script.

When I run a task, I get an Ant error that says

Variable references non-existent resource : ${workspace_loc:/MyProject_JAVA/dev-new/build.xml}.

The problem is this path is wrong. It should be :

/MyProject_JAVA/dev/dev-new/build.xml.

I can go into External Tools and change the config for this one build, but if I try to run the task again, I get the same error.

How do I change where Ant thinks the build file is?

标签: java eclipse ant
3条回答
你好瞎i
2楼-- · 2019-02-22 00:41

I think your closing curly brace is misplaced and I'm not sure the colon is necessary. Try: ${workspace_loc}/MyProject_JAVA/dev-new/build.xml

EDIT: I'm assuming you are using this in your Ant Build external configuration's "Main" tab, in the "Base Directory" field.

EDIT 2: Actually, as I look at your description closer, it appears the MyProject_JAVA folder exists outside of the workspace. Is that correct? If so, try using ${project_loc} instead.

查看更多
戒情不戒烟
3楼-- · 2019-02-22 00:43

I met same problem , fortunately I solved it. Go into preferences of Eclipse, and edit Ant - Runtime - Classpath. You will find reason, and delete the error configured entry.


Error Pic


Solve Pic

查看更多
我想做一个坏孩纸
4楼-- · 2019-02-22 00:45

To add on to billni's answer, you may have an incorrectly defined Ant classpath.

Find the bad path within Window > Preferences > Ant > Runtime > Entries

I have 3 entry types:

  • Ant Home Entries

  • Global Entries

  • Contributed Entries

For my situation, the bad path was in > Global Entries

To fix this, remove the bad path by selecting > Remove

Add the new and correct path by either using > Add JARs... or > Add External JARs...

  • Add JARs... > allows you to add archives from your package explorer to your build path.

  • Add External JARs... > allows you to add archives from your local file system to your build path.

Assuming your path is correct, and that there are no other errors, your build should now work!

查看更多
登录 后发表回答