简体   繁体   English

如何在Eclipse中包含Apache Commons IO? (JAVA)

[英]How to include Apache Commons IO in Eclipse? (Java)

How can I configure my Eclipse installation to use classes from Apache Commons IO ? 如何配置Eclipse安装以使用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 IOUtil无法解决

What you need to do is this: How to import a jar in Eclipse 你需要做的是: 如何在Eclipse中导入jar 加罐子

下载Apache .jar文件并通过IDE(Eclipse)将它们添加到库中。

You also can use build tools eclipse plugins like m2eclipse or IAM (formerly Q4e ). 你也可以使用构建工具eclipse插件,如m2eclipseIAM (以前的Q4e )。

IAM can be be installed following those instructions , and ha sa great dependency viewer 可以按照这些说明安装IAM,并且是一个很好的依赖查看器

替代文字

Differences between m2eclipse and IAM are discussed here , there and here . m2eclipse的和IAM之间的差异进行了讨论这里那里这里

Q4E is event-oriented, I believe that m2e uses the console and stdin/out. Q4E是面向事件的,我相信m2e使用控制台和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 . 更大的一个是m2eclipse分叉并使用外部maven(用于运行maven目标)而iam/q4e仅使用iam/q4e
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. 它当然允许我们快速执行依赖分析视图和maven增量构建器中的其他“魔术”之类的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM