The import org.apache.tools cannot be resolved

J

John Smith

I am an Eclipse newbie who are trying to learn how to write tasks from
the following tutorial:
http://ant.apache.org/manual/index.html

example code from the tutorial:
import org.apache.tools.ant.Project;

public class HelloWorld {

private Project project;

public void setProject(Project proj) {
project = proj;
}

public void execute() {
String message = project.getProperty("ant.project.name");
project.log("Here is project '" + message + "'.",
Project.MSG_INFO);
}
}

I could not find the org.apache.tools.ant.jar package from the
http://ant.apache.org/ homepage.

How do I get around this "The import org.apache.tools cannot be
resolved" error?
 
O

Oliver Wong

John Smith said:
I am an Eclipse newbie who are trying to learn how to write tasks from
the following tutorial:
http://ant.apache.org/manual/index.html
[...]

I could not find the org.apache.tools.ant.jar package from the
http://ant.apache.org/ homepage.

How do I get around this "The import org.apache.tools cannot be
resolved" error?

http://ant.apache.org/manual/install.html#installing
<quote>
ant
+--- bin // contains launcher scripts
|
+--- lib // contains Ant jars plus necessary dependencies
</quote>


Did you check the ant/lib directory?

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top