Here's the manual way to configure Eclipse to mimic what ant will do using the build.xml file. This should get you started:
Open Eclipse, open the "Java"
Perspective. Right click the project and choose "Build Path / Configure Build Path"
. Alternatively click "Project"
Menu, and choose "properties"
, then click "Java Build Path"
. Click the Libraries Tab. This is where you tell Eclipse where the jars needed build your project are located.
From the build.xml snippet, the first "<fileset>"
specifies that all the jars you need are under the <project>/libs
directory (I'm guessing that ${libs.dir}
corresponds to "libs"
but you might want to double check. It should be defined near the top of build.xml). So click, "Add Jars..."
, navigate into <project>/libs
, highlight all the jars inside the directory and then click "Ok"
.
The first and second <pathelement>
tags are telling ant to use the current directory and the classes directory. Eclipse should already take care of this by default, but to double check, click on the "Source"
Tab (should be in the same "Java Build Path"
dialog as the "Libraries" tab). The default output folder
shows where eclipse will compile java code to .class files. The Source folders on build path
shows where all your source code is that Eclipse should try to compile.
Finally, The last two <pathelement>
tags tell ant to use some resource/config files under ${configuration.dir}/langs
and ${fits.dir}/xml/nlnz
. You can add these similar to the way you added the jars. Click "Libraries"
Tab. Then choose "Add Class Folder"
and highlight both the "langs"
and "nlnz"
folders.
Hope this give you some insight into where Eclipse looks for jar dependencies, class files and resources.
Having said all this, as you become more familiar with Eclipse and build tools, you'll probably discover that this probably isn't the best way to go because it's very easy for the build.xml and eclipse configuration to get out of sync. There are ways to tell eclipse to build using an ant build.xml file (check out File->New Project->Java Project form Existing Ant Buildfile
). And there are also ways to run ant targets from within Eclipse (check out Window -> show view -> ant
).