Java eclipse:在eclipse插件项目中导入jar文件 [英] Java eclipse : Importing jar file in eclipse plugin project

查看:225
本文介绍了Java eclipse:在eclipse插件项目中导入jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将插件项目命名为 DB2
它的目的是连接到数据库并更新其值每次我保存工作项
当我尝试从我的桌面导入 db2jcc.jar 文件给我错误!



以下是导入时遇到的错误的屏幕截图:



解决方案

因为错过了项目中的库jar。



然后在 Window Package Explorer 中右键单击名称项目,您可以执行一个两步:


  1. 所以你必须进入项目的属性,然后转到 Java Build PAth

  2. 构建路径 - > 配置构建路径(右键单击窗口中的名称项目包资源管理器)。

所以你有这个窗口:



添加外部JAR ,转到文件的路径.jar,检查文件 db2jcc.jar ,请按完成,现在您将拥有该项目的库。



OR



如果您构建Maven项目,请在 pom.xml 中添加 db2jcc 的依赖关系。 / p>

 <依赖关系> 
< groupId> cn.guoyukun.jdbc< / groupId>
< artifactId> db2jcc< / artifactId>
< version> 1.4.2< / version>
< / dependency>

LINK


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:

  1. So you have to go in Properties of you project and go to Java Build PAth
  2. 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>

LINK

这篇关于Java eclipse:在eclipse插件项目中导入jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆