2009-11-20 26 views
6

Làm cách nào tôi có thể định cấu hình cài đặt Eclipse của mình để sử dụng các lớp học từ Apache Commons IO?Làm thế nào để bao gồm Apache Commons IO trong Eclipse? (Java)

Tôi muốn sử dụng mã này:

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

Nhưng nó mang lại cho các lỗi:

IOUtil cannot be resolved

+0

Bạn có sử dụng bất kỳ công cụ xây dựng, i. e. Ant hoặc Maven hoặc Ivy? Họ có thể giúp bạn quản lý sự phụ thuộc. –

+0

giới thiệu tôi đến một liên kết để biết thêm về họ và sử dụng số điện thoại – rover12

+0

http://ant.apache.org/ http://maven.apache.org/ http://ant.apache.org/ivy/ –

Trả lời

4

Bạn cũng có thể sử dụng công cụ xây dựng plugins eclipse như m2eclipse hoặc IAM (trước đây là Q4e).

IAM có thể được cài đặt sau those instructions, và ha là một lớn dependency viewer

alt text

Sự khác nhau giữa m2eclipse và IAM được thảo luận here, therehere.

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.

4

Tải Apache .jar file và thêm chúng vào thư viện thông qua IDE của bạn (Eclipse).

+0

không thể tìm thấy nó trên internet .. giúp tôi tìm thấy nó – rover12

+0

http://www.google.co.uk/search? q = apache + commons + io - một nơi nào đó trong ba lần truy cập đầu tiên, có thể ở đây: http://commons.apache.org/downloads/download_io.cgi – Grundlefleck

Các vấn đề liên quan