简体   繁体   English

将Java项目转换为Eclipse插件开发项目时遇到麻烦

[英]Having trouble converting Java Project to Eclipse Plug-in Development Project

I am going through The Eclipse Debug Framework tutorial which was presented at Eclipse con 2005 ( https://www.eclipsecon.org/2005/tutorials.html ). 我正在浏览Eclipse con 2005( https://www.eclipsecon.org/2005/tutorials.html )上介绍的Eclipse Debug Framework教程。 The Zip file (which can be downloaded from the link) contains 7 exercises. Zip文件(可从链接下载)包含7个练习。 For each exercise an initial code base consisting of two plug-ins is provided - example.debug.core and example.debug.ui . 对于每个练习,都提供了一个由两个插件组成的初始代码库-example.debug.coreexample.debug.ui

I tried to import these projects as Plugin and fragments but it doesn't work. 我试图将这些项目作为插件和片段导入,但是不起作用。 (These Projects are not shown as Plugin Projects in the Dialog) (这些项目在对话框中未显示为插件项目)

So then I decided to import these projects as Java Projects by "File > Import > Existing Project into Workspace" but then I can't seem to convert them to PDE Projects. 因此,我决定通过“文件>导入>现有项目到工作区”将这些项目导入为Java项目 ,但随后似乎无法将它们转换为PDE项目。 I tried it by following these instructions here . 我按照这里的这些说明进行尝试。

I am trying to convert these Projects to Plugin Projects because otherwise I can't seem import plugins to the Java classes in these projects 我正在尝试将这些项目转换为插件项目,因为否则我似乎无法将插件导入这些项目中的Java类

even though I have already added these plugins as Dependencies.. 即使我已经将这些插件添加为Dependencies ..

So any Ideas? 有什么想法吗? I am using Eclipse Modeling Tools (Luna). 我正在使用Eclipse建模工具(Luna)。 In tutorial they recommend using Eclipse SDK, version 3.1M5. 在教程中,他们建议使用Eclipse SDK 3.1M5版。

'Import > Existing Projects into Workspace' works for me. “导入>将现有项目导入工作区”为我工作。

For the 'root directory' choose the 'exercise1.1' directory. 对于“根目录”,选择“ exercise1.1”目录。 The two projects should then be listed in the projects list. 然后应在项目列表中列出这两个项目。

But these projects are 10 years old and are using the old style plugin.xml format which is not supported by default by current Eclipse builds. 但是这些项目已经使用了10年,并且使用的是旧样式的plugin.xml格式,当前的Eclipse构建默认不支持该格式。 This results in lots of import errors. 这导致很多导入错误。

Thanks, now it works. 谢谢,现在可以了。 This is what I did. 这就是我所做的。

Open plugin.xml file in the editor and Navigate to Overview Tab . 在编辑器中打开plugin.xml文件,然后导航到Overview Tab There under the section Plugin Content you would find an option to Create an OSGi Bundle Manifest OR if there is no such option then a Message asking you to either write a Manifest.MF file manually or to first install Eclipse 2.0 style plugin support . 在“ 插件内容 ”部分下,您会找到创建OSGi Bundle清单的选项, 或者,如果没有该选项,则显示一条消息,要求您手动编写Manifest.MF文件或首先安装Eclipse 2.0样式插件支持 (Help> Install New Software, use this update site http://download.eclipse.org/eclipse/updates/4.4 ). (帮助>安装新软件,请使用此更新站点http://download.eclipse.org/eclipse/updates/4.4 )。 You will find 'Eclipse 2.0 Style Plugin Support' in the 'Eclipse Tests, Examples and Extras' section. 您将在“ Eclipse测试,示例和其他功能”部分中找到“ Eclipse 2.0样式插件支持”。

checkout this link for more info ( Tools for Eclipse 2.0 plugins upgrade ) 查看此链接以获取更多信息( Eclipse 2.0插件工具升级

Once installed old plugins can run and also a Create OSGi Bundle Manifest option will appear under Plugin Content section if it wasn't there earlier... 安装后,旧的插件可以运行,并且如果之前没有出现,则“ 插件内容”部分下也会出现“创建OSGi捆绑包清单”选项...

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

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