tags:

views:

212

answers:

3

How can I configure my Eclipse installation to use classes from Apache Commons IO?

I want to use this code:

IOUtil.write(encoded, new FileOutputStream(new File("target-file.txt")))

But it gives the error:

IOUtil cannot be resolved

A: 

Add it to the project's build path. Drop the JAR somewhere in the project (I'd recommend creating a lib folder for that stuff) and add it as library to project's build path.

BalusC
A: 

Download Apache .jar files and add them to library through your IDE (Eclipse).

Mykola Golubyev
cant find it on the internet .. help me find it
rover12
http://www.google.co.uk/search?q=apache+commons+io - somewhere among the first three hits, probably here: http://commons.apache.org/downloads/download_io.cgi
Grundlefleck
+2  A: 

You also can use build tools eclipse plugins like m2eclipse or IAM (formerly Q4e).

IAM can be be installed following those instructions, and ha s a great dependency viewer

alt text

Differences between m2eclipse and IAM are discussed here, there and here.

Q4E is event-oriented, I believe that m2e uses the console and stdin/out.

A bigger one is that m2eclipse forks and uses an external maven (for running maven goals) while iam/q4e only uses the embedder.
Our position here is that it is the way to go, allowing deep integration and better performance.
It certainly has allowed us to quickly do things like the dependency analysis view and some other "magic" in the maven incremental builder.

VonC