Basically, I created a build.xml for Apache Ant. I use all the .jar files such as easymock.jar, junit.jar, which I downloaded straight from the their websites for my library (set in build.xml).
When I created a new unit test file using those two above .jar files by:
import static org.easymock.EasyMock.expect;
import static org.junit.Assert.*;
Eclipse generated bunch of errors. However, when I ran build.xml as Ant, this didn’t seem to be a problem (no compile errors). I guess Eclipse doesn’t recognize the external libraries until it actually compiles. How do I ignore these errors for certain unit test files? Or more generally, make Eclipse recognize external libraries?
Look in
Project properties->Java Build Path. This has options to add jars to your project.