如何在eclipse java中添加第三方包 [英] How to add third party package in eclipse java
本文介绍了如何在eclipse java中添加第三方包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Eclipse编辑器中编写一个java程序。出于这个原因,我想添加kfka第三方库。我在程序的顶部添加了这一行
I am trying to write a java program in Eclipse editor. For this reason i want to add kfka third party library. I add this line in top of the program
import kafka.javaapi.producer.Producer;
但它给了我错误。
导入kafka无法解析。。
我是java和eclipse的新手,搜索从过去1天的解决方案。
我尝试过:
我从这里下载了Jar文件,并将其添加到Project中br />
属性 - > Java构建路径 - >添加外部jar
但仍然得到相同的错误。
but it giving me error.
"The import kafka cannot be resolved. ".
I am new to java and eclipse, searching for the solution from last 1 day.
What I have tried:
I downloaded Jar file from here, and added it to Project using
Properties -> Java Build Path -> Add External Jar
But still getting the same error.
推荐答案
您的代码和下载的jar可能不匹配,请参阅 API - 什么是kafka.javaapi之间的差异*和org.apache.kafka。*? - 堆栈溢出的[ ^ ]。
Possibly there is a mismatch between your code and the jar you downloaded, see api - what's the difference between kafka.javaapi.* and org.apache.kafka.*? - Stack Overflow[^].
这篇关于如何在eclipse java中添加第三方包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文