开发者

Eclipse RCP standalone export problem with Groovy scripts

开发者 https://www.devze.com 2022-12-31 10:07 出处:网络
I am trying to export a standalone RCP app using Eclipse 3.5.2. The app has a main pure Java plug-in, and a Java / Groovy plug-in that is used by the main plug-in.

I am trying to export a standalone RCP app using Eclipse 3.5.2.

The app has a main pure Java plug-in, and a Java / Groovy plug-in that is used by the main plug-in.

When I export the main RCP plug-in using the "Export Wizard", I get compiler errors saying that the Groovy classes cannot be found, e.g

ERROR in C:\mysrc\src\ch\calcs\providers\CalcProvide开发者_运维问答r.java (at line 8)
 import ch.calcs.ArgSet;

This plug-in works fine when run from within Eclipse.

EDIT: Also tried this using a hand-crafted plug-in (JAR) from link here

Any ideas?


The problem is that the PDE plugin doesn't use the same compiler as the Java plugin. Please read this blog post, which tells you how to include groovy sources in your PDE builds:

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

Essentially, you need to put something like this into your build.properties file:

sourceFileExtensions=*.java, *.groovy
compilerAdapter=org.codehaus.groovy.eclipse.ant.GroovyCompilerAdapter
compilerAdapter.useLog=true  # this ensures that exceptions are logged to the proper log file.


Did you check the export did reference all the necessary plugins?
(a bit like clicking on the "Add Required Plug-ins" button when you launch it from Eclipse:

alt text http://www.vogella.de/articles/RichClientPlatform/images/launchconfiguration30.gif)


For checking that your plugin is correct (before exporting it), see the section "Dependencies" of the Vogella RCP tutorial:

alt text http://www.vogella.de/articles/RichClientPlatform/images/product50.gif

You will see that same button "Add Required Plug-ins".


Another thing you could check would be if you are exporting the required packages (in the Runtime tab) and if you selected your source folders for the binary build (in the Build tab of the manifest editor).

0

精彩评论

暂无评论...
验证码 换一张
取 消