7

groovy eclipse plugin version: 1.7.5.xx-20101020-1000-e36-release.

import com.jidesoft.swing.JideSplitButton

@Grab(group='com.jidesoft', module='jide-oss', version='[2.2.1,2.3.0)')
public class TestClassAnnotation {
    public static String testMethod () {
        return JideSplitButton.class.name
    }
}

new TestClassAnnotation().testMethod()

the first line error: Groovy:unable to resolve class com.jidesoft.swing.JideSplitButton

it can run as groovy shell, but the error warning is bore

M. Justin
  • 14,487
  • 7
  • 91
  • 130
atian25
  • 4,166
  • 8
  • 37
  • 60

3 Answers3

0

Try placing @Grab right above the import statement. Just like that:

 @Grab(group='com.jidesoft', module='jide-oss',version='[2.2.1,2.3.0]') 
 import com.jidesoft.swing.JideSplitButton

... your code continues here
Alex Khvatov
  • 1,415
  • 3
  • 14
  • 23
0

When I compile this in the editor, I get the same error as I do when I compile or run from the command line:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Error grabbing Grapes -- [unresolved dependency: com.jidesoft#jide-oss;[2.2.1,2.3.0): not found]

(and then a very long stack trace)

Is this what you are seeing?

Andrew Eisenberg
  • 28,387
  • 9
  • 92
  • 148
  • no, it can compile and run exactly what I need. but the ide waring at the the first line error: Groovy:unable to resolve class com.jidesoft.swing.JideSplitButton. – atian25 Dec 22 '10 at 03:45
  • my ide is lastest version of STS, and then groovy plugin – atian25 Dec 22 '10 at 03:47
  • Well, unfortunately, I can't reproduce the behavior that you are seeing. I'd recommend raising a bug on the issue tracker: http://jira.codehaus.org/browse/GRECLIPSE – Andrew Eisenberg Dec 22 '10 at 16:08
0

I'm rather late to this question, but I wonder if
@Grab(group='com.jidesoft', module='jide-oss', version='[2.2.1,2.3.0)')
shouldn't be
@Grab(group='com.jidesoft', module='jide-oss', version='[2.2.1,2.3.0]')

It looks to me like a syntax error where groovy expects to be passed a list.

avgvstvs
  • 6,196
  • 6
  • 43
  • 74