1
votes

I have a ANT project (ant 1.8.4) that builds fine with command line. I needed to make this ant build file into eclipse project. I googled this site to import ant-1.8.4 as a eclipse project, but I ended up having around 1K build errors.

The issue is that I have to add many jar files in the build path. I needed log4j, common-io, and on and on.

Is there any way to solve this jar file issue? The fact that ant builds the code without issue means that all the necessary jar files are found and linked automatically with ant. What step might be needed to make eclipse find all the jar files necessary?

1

1 Answers

0
votes

Eclipse doesn't use your Ant file for building. Instead, you have to tell it the jars used and where the source is located. It will then use that information to compile the source.

I'm not a developers, so I am not 100% sure what happens if you have a really funky project where you don't want to compile all the source, or first have to process it, or manipulate the classpath as you compile. However, 90% of Java projects are fairly straight forward when it comes to at least compiling the code: My source is here, the dependent jars are here. Please compile.

Of the other 10%, 9.8% usually are using things like WSDL or Ivy, but Eclipse has plugins for these. You need to download the plugins and configure them, but once this is done, Eclipse can work without needing the build.xml file to figure out how to compile the code.

It's the last 0.2% that are the killers. However, you can always tell Eclipse to spawn an Ant build using the build.xml file. Then, you need to tell Eclipse where the classfiles are located and the jars (and other resources that might not be in the *.class file directory, and you can still use the Eclipse debugger.