-->

How can I avoid this Ant Build error?

2020-08-01 06:01发布

问题:

What is this ant build error in eclipse?

When I click the Ant Build I have the error message shown below.

Build failed

Reason: Unable to find an Ant file to run.

Could you please help me solve it?

回答1:

Quoting from here

  1. Create a new project in Eclipse
  2. After the project is created, look in the package explorer window pane on the left and right click on the src folder.
  3. 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.
  4. After clicking Import, select File System under the general folder. Click Next.
  5. 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.
  6. Select which files you want to add and click Finish.
  7. 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.


标签: java eclipse ant