Eclipse 开发plug-in 引用其它项目时 导出plug-in的方法

现象描述:

plug-in项目如果引用了其它的项目,在调试时是正常的,但是在导出时可能会报错。
这里写图片描述

引用的库会提示找不到:
这里写图片描述

处理方法:

原因分析

问题原因是ToErpLib不是eclipse 的plugin,而是java projects。事实上它们没有包含在最终导出的jar包里。

网上有介绍在mac系统下,使用ln创建链接,把被引用项目链接到目标项目里。我用的是windows系统,采用下面方案:

操作

ToErpLib导出jar,
这里写图片描述

为了方便引用,选择对项目不要压缩。导出路径直接导入到UDSRCP/lib目录里。

在UDSRCP项目里选择ToErpLib.jar,右键Build Path - Add To Build Path,

然后修改META-INFO/MANIFEST.MF

Bundle-ClassPath: lib/poi-3.5.jar,
 .,
 lib/classes12.jar,
 lib/sqljdbc4.jar,
 lib/sigar.jar,
 lib/ToErpLib.jar    这里是新增的

再执行导出,可以正常运行。
不再报错。

在可视化视图查看MANIFEST.MF,可以看到现在显示是这样的:
这里写图片描述

另外要注意,现在是引用的jar文件,所以项目之间的依赖关系就可以不要了。

参考:
http://stackoverflow.com/questions/13983819/errors-in-exporting-eclipse-deployable-plug-ins-and-fragments

【CSDN首发】,百度上的不是完整版本,非本人发布 本教程素材来源于网络,经过本人的整理、添加以及部分的重写,将原有的Eclipse3.3版本的一些内容完全迁移到Eclipse3.6版本上来。基于开源以及分享的精神,特地将教程分享到网络上,希望所有需要的朋友因此而受益,也希望大家能有版本意识,转载注明来自salever@126.com。 之前有一套基于Eclipse3.3版本的教程,也是本人整理,由于本人的疏忽,导致网络上的版本各不相同,但分享已久,无法改变,希望大家谅解并使用新版本的教程。 本教程由本人发布在www.ceclipse.org以及本人的blog中,希望对大家有所帮助,也希望各位喜欢分享的朋友在转载注明,谢谢。 手头有一些不错的Eclipse资料,只可惜它用的Eclipse还是3.3版本的,很多东西都已经无法使用。最近抽些间,更新到eclipse3.6上来,既作为为广大Eclipser入门plugin/RCP开发的一个方便之门,也是对自己近年来学习的一个总结吧。 每一章都会单独提取出来,并尽可能的独立于其他章节,更新中的源代码工程也会附加在附件里面下载。 等到所有的章节都弄完以后,再统一发一个完整版本。 特点: 1,基于Eclipse 3.6.0 2,所有代码均可直接复制运行 3,简单、全面,合适初学者入手 目录 1 富客户端平台 .....................................................................................................................................9 1.1 概述 ..............................................................................................................................................9 1.2 ECLIPSE RCP 建设风格——插件,扩展和扩展点 .....................................................................9 1.3 RCP与PLUGIN ...............................................................................................................................9 2 创建第一个RCP程序 ........................................................................................................................11 2.1 创建一个RCP程序 ......................................................................................................................11 2.2 启动RCP程序 ..............................................................................................................................15 2.3 程序VS 产品 ..............................................................................................................................17 2.4 维护LAUNCH配置 .......................................................................................................................17 2.5 可能的APPLICATION ID 错误: ..................................................................................................20 2.6 应用程序的PLUGIN ID ................................................................................................................21 3 ACTIONS的用法(菜单栏和工具栏) ............................................................................................22 3.1 概述 ............................................................................................................................................22 3.2 通过编码添加 .............................................................................................................................22 3.3 “扩展”方式添加菜单和工具栏 ..................................................................................................25 3.4 添加全局快捷键 .........................................................................................................................31 3.4.1 Command+Handler+Binding 绑定 ......................................................................................31 3.4.2 Action+Command+Binding绑定 ..........................................................................................33 4 系统托盘 ...........................................................................................................................................37 5 视图 ...................................................................................................................................................42 5.1 添加示例视图 .............................................................................................................................42 5.2 添加自定义视图 .........................................................................................................................47 5.3 向VIEW里添加ACTION ................................................................................................................52 RCP/Plug-in 开发自学教程 salever@126.com - 4 - 6 编辑器 ...............................................................................................................................................58 6.1 概述 ............................................................................................................................................58 6.2 创建工程 ....................................................................................................................................58 6.3 添加编辑器 ................................................................................................................................59 6.4 调用编辑器 ................................................................................................................................67 6.5 实例:文本编辑器实现 .............................................................................................................68 6.5.1 新建工程 ..............................................................................................................................68 6.5.2 添加菜单栏和工具栏 ..........................................................................................................70 6.5.3 添加编辑器 ..........................................................................................................................75 7 对话框 ...............................................................................................................................................86 7.1 概述 ............................................................................................................................................86 7.2 预定义的对话框 .........................................................................................................................87 7.2.1 概述 .....................................................................................................................................87 7.2.2 创建工程 ..............................................................................................................................87 7.2.3 添加菜单 ..............................................................................................................................87 7.2.4 调用对话框 ..........................................................................................................................87 7.3 用户自定义对话框 .....................................................................................................................89 7.3.1 概述 .....................................................................................................................................89 7.3.2 创建SWT/JFace工程 ...........................................................................................................89 7.3.3 自定义Dialog .......................................................................................................................91 7.3.4 说明 .....................................................................................................................................97 8 向导 ...................................................................................................................................................98 8.1 概述 ............................................................................................................................................98 8.2 示例 ............................................................................................................................................98 9 首选项 .............................................................................................................................................106 RCP/Plug-in 开发自学教程 salever@126.com - 5 - 9.1 首选项 ......................................................................................................................................106 9.2 使用首选项 ...............................................................................................................................106 9.3 首选项页 ..................................................................................................................................112 10 添加状态栏 ...................................................................................................................................117 10.1 简介 ........................................................................................................................................117 10.2 安装状态栏 .............................................................................................................................117 10.3 初始化状态条 .........................................................................................................................118 10.4 控制状态栏 .............................................................................................................................120 11 透视图 ...........................................................................................................................................123 11.1 简介 ........................................................................................................................................123 11.2 添加透视图 .............................................................................................................................123 11.3 显示透视图工具栏 .................................................................................................................128 11.4 显示透视图菜单 .....................................................................................................................130 12 进度条 ...........................................................................................................................................133 12.1 简介 ........................................................................................................................................133 12.2 进度条对话框 .........................................................................................................................133 12.3 JOB进度条 ...............................................................................................................................135 13 使用第三方JAR .............................................................................................................................140 13.1 概述 ........................................................................................................................................140 13.2 向构建路径中添加JAR ...........................................................................................................140 13.3 使JAR在你的运行路径里有效 ................................................................................................141 14 提示和策略 ...................................................................................................................................143 14.1 控制台日志 .............................................................................................................................143 14.2 保存用户的布局 .....................................................................................................................145 RCP/Plug-in 开发自学教程 salever@126.com - 6 - 14.3 获得DISPLAY ............................................................................................................................146 14.4 使用ECLIPSE的“保存”ACTION .................................................................................................146 14.5 向你的程序添加错误日志视图 .............................................................................................146 15 产品 ...............................................................................................................................................149 15.1 概述 ........................................................................................................................................149 15.2 PRODUCT配置文件 ...................................................................................................................149 15.3 测试你的产品 .........................................................................................................................153 15.4 欢迎页面 ................................................................................................................................153 15.5 商标 ........................................................................................................................................154 15.6 风格化LAUNCHING ..................................................................................................................155 15.7 发布你的产品 .........................................................................................................................156 15.8 创建一个帮助插件工程 .........................................................................................................159 16 专题一 ECLIPSE的版本和发行包 ..............................................................................................164 16.1 版本 VERSION .........................................................................................................................164 16.1.1 版本的理解 ......................................................................................................................164 16.1.2 Eclipse的版本 ...................................................................................................................164 16.1.3 版本的选择和下载 ..........................................................................................................164 16.2 发行包 EDITION ......................................................................................................................166 16.2.1 发行包的理解 ..................................................................................................................166 16.2.2 Eclipse的发行包 ...............................................................................................................166 17 专题二 ECLIPSE的国际化与语言包 ..........................................................................................169 17.1 国际化 ....................................................................................................................................169 17.1.1 Externalize Strings ............................................................................................................169 17.1.2 中文属性文件 ..................................................................................................................175 17.1.3 国际化文件 ......................................................................................................................176 17.1.4 指定语言环境 ..................................................................................................................176 RCP/Plug-in 开发自学教程 salever@126.com - 7 - 17.1.5 Propedit工具 .....................................................................................................................177 17.2 语言包 ....................................................................................................................................177 17.2.1 Babel小组 .........................................................................................................................177 17.2.2 中文语言包的下载 ..........................................................................................................178 18 专题三 DECORATOR与MARKER的使用 .................................................................................180 18.1 简介 ........................................................................................................................................180 18.2 扩展DECORATOR ......................................................................................................................180 18.3 扩展MARKER ...........................................................................................................................184 19 专题四 RUN/DEBUG LAUNCHER实现 ....................................................................................190 19.1 ECLIPSE RUN/DEBUG 实现流程 ...............................................................................................190 19.2 扩展CONFIGURATIONTYPE .......................................................................................................192 19.3 扩展ILAUNCHSHORTCUT .........................................................................................................194 19.4 创建RUN/DEBUG CONFIGURATION界面 ..................................................................................197 19.5 指定RUN/DEBUG显示图片 .....................................................................................................204 19.6 说明 ........................................................................................................................................205 20 专题五 EQUINOX P2 方式实现RCP自动更新 .........................................................................207 20.1 概述 ........................................................................................................................................207 20.2 示例 ........................................................................................................................................207 20.2.1 Feature概念 .......................................................................................................................207 20.2.2 配置Product .....................................................................................................................210 20.2.3 配置Feature ......................................................................................................................211 20.2.4 product导出 ......................................................................................................................213 20.2.5 配置Equinox P2 ...............................................................................................................214 20.2.6 配置 Update Site .............................................................................................................215 21 专题六 COMMON NAVIGATOR FRAMEWORK初探 .............................................................216
Book Description Publication Date: December 21, 2008 | ISBN-10: 0321553462 | ISBN-13: 978-0321553461 | Edition: 3 Producing a commercial-quality plug-in means going above and beyond the minimal requirements needed to integrate with Eclipse. It means attending to all those details that contribute to the “fit and polish” of a commercial offering. This comprehensive guide covers the entire process of plug-in development, including all the extra steps needed to achieve the highest quality results. Building on two internationally best-selling previous editions, Eclipse Plug-ins, Third Edition, has been fully revised to reflect the powerful new capabilities of Eclipse 3.4. Leading Eclipse experts Eric Clayberg and Dan Rubel present detailed, practical coverage of every aspect of plug-in development, as well as specific, proven solutions for the challenges developers are most likely to encounter. All code examples, relevant API listings, diagrams, and screen captures have been thoroughly updated to reflect both the Eclipse 3.4 API and the latest Java syntax. In addition, Clayberg and Rubel have completely revamped their popular Favorites View case study, reworking much of its content and recreating its code from scratch. The authors carefully cover new functionality added to existing Eclipse features, such as views and editors, and fully explain brand-new features such as Commands, GEF, and PDE Build. This extensively revised edition Thoroughly covers Eclipse’s new preferences Illuminates the powerful new Eclipse Command Framework, which replaces Eclipse’s older Action Framework Presents extensive new discussions of using commands with views and editors Introduces Mylyn, the new task-focused interface that reduces information overload and simplifies multi-tasking Contains an all-new chapter on using the Graphical Editing Framework (GEF) to build dynamic, interactive graphical user interface elements Walks you step by step through the entire PDE Build process Shows how to create update sites with p2, which replaces Eclipse’s old Update Manager This book is designed for every experienced developer interested in extending the Eclipse platform, the Rational Software Development Platform, or any other platform that supports Eclipse plug-ins.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程圈子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值