Java eclipse:在eclipse插件项目中导入jar文件 [英] Java eclipse : Importing jar file in eclipse plugin project
问题描述
DB2
。 它的目的是连接到数据库并更新其值每次我保存工作项
当我尝试从我的桌面导入
db2jcc.jar
文件给我错误! 以下是导入时遇到的错误的屏幕截图:
因为错过了项目中的库jar。
然后在 Window Package Explorer 中右键单击名称项目,您可以执行一个两步:
- 所以你必须进入项目的属性,然后转到 Java Build PAth
- 或构建路径 - > 配置构建路径(右键单击窗口中的名称项目包资源管理器)。
所以你有这个窗口:
按添加外部JAR ,转到文件的路径.jar,检查文件 db2jcc.jar ,请按完成,现在您将拥有该项目的库。
OR
如果您构建Maven项目,请在 pom.xml 中添加 db2jcc 的依赖关系。 / p>
<依赖关系>
< groupId> cn.guoyukun.jdbc< / groupId>
< artifactId> db2jcc< / artifactId>
< version> 1.4.2< / version>
< / dependency>
I made plugin project named DB2
.
Its purpose is to connect to database and update its values every time I save workitem
When I try to import db2jcc.jar
file from my desktop it gives me error!
Following is screen shot of error i encountered while importing:
Because miss the library jar in project.
Then press right click on name project inside Window Package Explorer and you can do one about two step:
- So you have to go in Properties of you project and go to Java Build PAth
- Or Build Path->configure Build Path (right click on name project inside window Package Explorer).
So you have this window:
Press Add External JAR , go to path of you file .jar, check the file db2jcc.jar, press Finish and now you will have the library in you project.
OR
Add the dependencie of db2jcc in the pom.xml if you build a Maven Project.
<dependency>
<groupId>cn.guoyukun.jdbc</groupId>
<artifactId>db2jcc</artifactId>
<version>1.4.2</version>
</dependency>
这篇关于Java eclipse:在eclipse插件项目中导入jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!