Hi

I downloaded a simple Java application using Spring, which
works in Eclipse if I manually add the needed jar libraries. However, I would rather use the existing build.xml, which includes the libraries via

<fileset dir=...>

and

<include...>

nodes.
If I rightclick the build.xml and click on Run As->Ant Build, the project compiles, too. Nevertheless, when I view the Java files in Eclipse, there are still errors marked, e.g. "The import org.springframework cannot be resolved", so maybe the automatic compilation doesn't work.
If I run ant in the terminal in the project directory the project runs, too.


Thanks in advance


Johannes Riecken

You need to tell Eclipse where the jar files are too, or it won't know where to look for them.

Okay, thank you for the info, I'll just declare it twice then.

That's probably your only option unfortunately. I don't think Eclipse uses Ant natively for building, unlike Netbeans.

That's probably your only option unfortunately. I don't think Eclipse uses Ant natively for building, unlike Netbeans.

Hm, I tried it in Netbeans, but although the project now compiles without further settings, you still have to add the JARs in the project properties, . There it's stated: "This classpath is used by the IDE features like code completion and refactoring while editing the Java sources. These settings do not modify the build script." So I don't think Netbeans has a real advantage in this respect or am I missing something?

Ah, if you are using a Free-form Project then yeah, you'll have to specify them in both places separately. I guess it's only Standard Projects that synchronize some of that for you. Sorry for the misdirect.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.