如何在Eclipse RCP项目中使用groovy? [英] How to use groovy inside a Eclipse RCP project?

查看:135
本文介绍了如何在Eclipse RCP项目中使用groovy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Eclipse RCP项目,我想在其中使用Groovy。我试图做的是:

1)添加Groovy Nature

2)在src文件夹下创建Groovy文件

3)调用来自View的createPartControl()方法的groovy类。



但是我得到了java.lang.ClassNotFoundException:fly.island.jface.Test和fly.island.jface.Test是一个groovy类。



如何在Eclipse RCP项目中使用groovy?

解决方案

使用最新版本的Groovy-Eclipse 2.1.0(或其中一个开发版本)。更新网站在这里:



http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/



此外,还有一些您在PDE构建时需要编写Groovy插件的步骤。我建议阅读:



http://contraptionsforprogramming.blogspot.com/2010/08/groovy-pde-redux.html



本质上,您需要包括您的rcp应用程序中的 org.codehaus.groovy 包,然后您需要对 build.properties 您的Groovy插件的文件(在博客文章中详细介绍)。


I have a Eclipse RCP project, and I want to use Groovy inside it. what I try to do is :
1) add "Groovy Nature"
2) create Groovy files under the "src" folder
3) call the groovy class from the "View"'s createPartControl() method.

But I got the "java.lang.ClassNotFoundException: fly.island.jface.Test", and the "fly.island.jface.Test" is a groovy class.

What should I do to use groovy inside the Eclipse RCP project?

解决方案

Use the latest version of Groovy-Eclipse 2.1.0 (or one of the dev builds). Update site is here:

http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/

Additionally, there are some steps you need to do to compile the groovy plugins when you the PDE build. I'd recommend reading:

http://contraptionsforprogramming.blogspot.com/2010/08/groovy-pde-redux.html

Essentially, you need to include the org.codehaus.groovy bundle in your rcp app, and then you need to make some changes to the build.properties file of your Groovy plugins (explained in detail on the blog post).

这篇关于如何在Eclipse RCP项目中使用groovy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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