在eclipse中安装velocity编辑器、Freemarker编辑器

记录以便今后重新搭环境时查找。
1.在myeclipse中增加velocity支持的包后,在集成velocity的velocity编辑器,会是开发更方便快捷。
Veloeclipse的网站http://code.google.com/p/veloeclipse/,
在myeclipse中安装Veloeclipse时,在地址栏中输入: http://veloeclipse.googlecode.com/svn/trunk/update/

2.在myeclipse中安装freemarker编辑器,在URL栏中输入:http://www.freemarker.org/eclipse/update
这个地址已经不能用了,只能用下面的方法来添加了。


eclipse正常情况下 是能自动识别新添加的 插件,并自动添加相应信息,但是如果eclipse 不能自动识别时,你就需要手动为eclipse添加相应的插件信息,即为 下面红字部分


   在MyEclipse7.0+的版本,自动安装行不通,因为在下载你填写的插件前,MyEclipse会下载一大堆自己的更新,这些更新 全都位于MyEclipse的服务器或者Pulse的服务器,这两个服务器在国内是无法访问的。

既然无法自动安装,就手动安装:
先打开 http://sourceforge.net/projects/freemarker-ide/files/页面,点击“下载”,
注意,要下载eclipse插件,而不是freemarker本身。 在下面的文件列表中选择“eclipse-plugin”文件夹,展开的文件就是各个版本的eclipse插件,
当前最新是: freemarker-ide-0.9.14.zip  http://sourceforge.net/projects/freemarker-ide/files/freemarker-ide/0.9.14/freemarker-ide-0.9.14.zip/download

下载完插件后,解压缩到:
\Program Files\Genuitec\Common\plugins\

解压后的目录:
\Program Files\Genuitec\Common\plugins\hudson.freemarker_ide_0.9.14

然后需要修改一个文件,这很关键:
\Program Files\Genuitec\MyEclipse 7.0\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info
在文件最后加入下面两行:
hudson.freemarker_ide,0.9.14,file:plugins\hudson.freemarker_ide_0.9.14\,4,false

(格式大概为:插件名,版本号,file:插件目录,4,false
插件名和版本号是由插件目录名字以下划线分割而得,file:后如果是目录结尾要有反斜杠、如果是.jar就不用,最后的4,false不知道是什么意思,不用管他)

然后重启动MyEclipse7.5,就可以用freemarker的eclipse plugin ide打开ftl文件了。

最后,要注意一下,\Program Files\Genuitec\Common\plugins\hudson.freemarker_ide_0.9.14 中的freemarker.jar可能是很旧的,如果发现ftl文件中的一些符号,如感叹号、双问号如果报告为错误,用新的 freemarker-2.3.15.jar替换之,把MANIFEST.MF里的Bundle-ClassPath也改为freemarker- 2.3.15.jar ,然后重启MyEclipse7.5就可以了。

猜你喜欢

转载自zpball.iteye.com/blog/1926463