Eclipse 3.4.1 新版尝试 插件安装

 开发工具Eclipse已经出3.4.1版本了,今天终于可以尝试一下新鲜,虽然在3.3.2的版本上面增加了P2和dropins,但是依然还有很多Bug,花费了半天时间,多少弄明白了些,在网上Google了一下,遇到相同问题的开发朋友有一箩筐,现在写在自己博客,提示自己别忘了哦,呵呵!

Eclipse 3.4.1 下载地址:
http://www.eclipse.org/downloads/

首先,Eclipse 3.4.1版本改变了插件安装的方式

前版本通过links和updatesite方式安装和更新插件,现版本已经废掉了links安装,转由dropins安装,link文件地址不变;updatesite安装没有前版本灵活了,只能默认安装到到eclipse目录,不便于管理;另外,dropins安装增强了功能,为unzipfiles安装插件提供了不少便利,英文原文如下:
    DropinsProvisioning operations should generally occur using the p2 UI, or by invoking
p2 tools or APIs. However, there are situations where scripts need to install plugins and features via file system operations, and have the new content dynamically discovered by the system either at startup, or while running. To support this kind of low-level manipulation of the system, p2 supports the notion of watched directories. A watched directory is a place where a user or script can drop files and have them discovered by p2. Various policies can be applied to watched directories to configure when they are checked for new content, and whether to eagerly install discovered content.

    The Eclipse platform ships with a default watched directory called dropins. The dropins folder is configured to be scanned during startup, and for changes to be immediately applied to the running system. Thus the dropins folder can be used much like the plugins directory was used in the past. A subtle twist on old behavior here is that plug-ins and features added to the dropins folder are properly installed into the system rather than being forced in. This means p2 has an opportunity to confirm that the new plug-in doesn't conflict with other installed plug-ins, and it can even go out and fetch any missing prerequisites of the newly dropped in plug-ins. This also means you can later use the GUI to install extra functionality that depends on the plug-ins in the dropins folder, since p2 knows about them and can reason about their dependencies. In other words, new plug-ins installed via the dropins folder behave exactly like plug-ins installed via the user interface. Note that updating plug-ins which are located under the dropins folder using the p2 UI will result in the updated plug-ins being saved under the main eclipse/plugins and eclipse/features folders and not under the dropins hierarchy as siblings to the older versions of the plug-ins, as might be expected.

    Supported dropins formatsThe dropins folder supports a variety of layouts, depending on the scale of your application and the desired degree of separation of its parts. The simplest layout is to just drop plug-ins in either jar or directory format directly into the dropins folder:
  eclipse/  
  dropins/    
    org.eclipse.core.tools_1.4.0.200710121455.jar    
    org.eclipse.releng.tools_3.3.0.v20070412/      
      plugin.xml      
      tools.jar      
   ... etc ...  
       ...

You can also drop in the traditional Eclipse application or extension layout directly in the dropins folder:
  eclipse/  
  dropins/    
   eclipse/      
     features/      
     plugins/

If you have various different components being dropped in, and you want to keep them separate, you can add an additional layer of folders immediately below the dropins folder that contain traditional Eclipse extensions:
  eclipse/  
  dropins/    
    emf/      
      eclipse/        
        features/        
        plugins/    
    gef/      
      eclipse/        
        features/        
        plugins/    
    ... etc ...

Finally, you can add link files as in the traditional Eclipse links folder:
  eclipse/  
  dropins/    
    emf.link

另外,当你用本地方法updatesite安装时,会发现eclipse会自动添加更新缺少的和旧版本的插件包,当然是在联网的条件下哦,很方便;还有就是P2提高了插件下载安装速度,网上介绍,有点像“BT”,如果发现的插件已经不存在了,还能够更新,BT建立在用户机子上,但是P2用的共享服务器,不影响自己的网速。


其次,eclipse启动,初始发现问题
  安装插件的时候,发现用updatesite方式安装,只能默认安装到Eclipse目录,虽然有插件管理器,但是还是很不便的,给插件安装分类是最好的方式;虽然有dropins为插件安装带来方便,但是很不灵敏,启动eclipse后插件依然没有加载进来,用删除configuration目录下org.eclipse.update文件夹也没有用,花了我2个小时,终于正明白了,在这上面和3.3.2版本还有些不一样,我除config.ini文件删除configuration目录下所有文件,居然启动Eclipse出错,捣鼓了一番,原来org.eclipse.equinox.simpleconfigurator这个文件夹还不能删除,经过网上查找,发现和P2有关,哦,原来如此,呵呵,觉得有些蹊跷。
  安装插件后,我卸掉插件,比如Pydev插件,嘿,我发现,居然启动还在,网上也没有查到,最后,我觉得前面那个org.eclipse.equinox.simpleconfigurator文件夹有些问题,打开发现bundles.info这个文件里面记录了所有已经安装使用的插件,这里居然还有个缓存,呵呵,找到pydev插件,删除记录,结果搞定。终于不会按照网友的说法,删除link文件后还要删除插件文件了,要是这样,3.4.1版本带来的方便岂不是被忽略了...

最后,eclipse 3.4.1版本的P2,已经是发展的方向,还有很多需要加强,软件执行速度感觉挺快的,看来Java在桌面编程上面已经得到了很大的发展;还有很多集成,eclipse就像主板,需要不断探索才能发现真正的魅力。

 

补充:
在eclipse 3.4.1中,不管是通过updatesite和dropins方式安装插件,都会出现卸载插件后还能加载的情况,除非删除插件源程序,原因就是configuration/org.eclipse.equinox.simpleconfigurator下面的记录要删除才能解决,用删除configuration/org.eclipse.update这个目录也没有用,但是别忘了,如果加载新插件或者重新再加载卸载的插件的时候,还必须得删除configuration/org.eclipse.update这个目录,觉得3.4.1这个版本还是有些怪怪的。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值