问题描述
我有一个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(或其中一个开发版本)。更新网站在这里:
此外,还有一些您在PDE构建时需要编写Groovy插件的步骤。我建议阅读:
本质上,您需要包括您的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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!