问题
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\CalcProvider.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?
回答1:
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.
回答2:
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".
回答3:
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).
来源:https://stackoverflow.com/questions/2858932/eclipse-rcp-standalone-export-problem-with-groovy-scripts