I am attempting to run a Groovy script in Eclipse but Eclipse is seemingly ignoring all of my import statements. If I hover over the errors it tells asks me to import the appropriate class (clicking on it does nothing).
I have the required jars in my build path and class path.
Sample code, pretty standard:
package scripts.blah
import foo.Bar;
class FooMain {
static main(String[] args){
Bar bar = new Bar();
}
}
Groovy:unable to resolve class Bar
Any help would be appreciated.
Three possibilities:
Forgot to actually build the project. Ouch. (build automatically was turned off in Eclipse)
Had the same problem. Adding those to my .classpath solved the problem:
<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.