Java 我怎样才能避免这个 Ant Build 错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23170959/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 21:10:27 来源:igfitidea点击:
How can I avoid this Ant Build error?
提问by karabugra05
What is this ant
build error in eclipse?
ant
eclipse 中的这个构建错误是什么?
When I click the Ant Build I have the error message shown below.
当我单击 Ant Build 时,出现如下所示的错误消息。
Build failed
Build failed
Reason: Unable to find an Ant file to run.
Reason: Unable to find an Ant file to run.
Could you please help me solve it?
你能帮我解决吗?
回答by mok
Quoting from here
从这里引用
- Create a new project in Eclipse
- After the project is created, look in the package explorer window pane on the left and right click on the src folder.
- There are two methods for the next step, you could either add a New > Class, and then copy and paste everything from your old java file to the new class (make sure the class name is the same), or the better route would be to Import.
- After clicking Import, select File System under the general folder. Click Next.
- Browse for the java folder where your source files are located. Once you click ok, it will add all of the source files to the right pane.
- Select which files you want to add and click Finish.
- Now if you look at your Package Explorer window you should see the source files. Now just compile them, and the error shouldn't appear and you can run them just like before.
- 在 Eclipse 中创建一个新项目
- 创建项目后,查看左侧的包资源管理器窗口窗格,然后右键单击 src 文件夹。
- 下一步有两种方法,您可以添加一个New > Class,然后将旧java文件中的所有内容复制并粘贴到新类中(确保类名相同),或者更好的路线是导入。
- 点击Import后,在general文件夹下选择File System。点击下一步。
- 浏览源文件所在的 java 文件夹。单击确定后,它会将所有源文件添加到右侧窗格中。
- 选择要添加的文件,然后单击完成。
- 现在,如果您查看 Package Explorer 窗口,您应该会看到源文件。现在只需编译它们,错误就不会出现,您可以像以前一样运行它们。