Please make sure to be using NetBeans IDE 6.0 Beta 2. If you're using something later (like a daily build), it might still work (and it probably should still work), but no promises. Once you've installed, you'll find a new category in the New File wizard, with various Groovy file templates:
Once you've created a Groovy file template, you'll see it has the same icon as Java source files. There's also support for the Java parts of Groovy, as indicated below:
The Groovy parts of Groovy are not supported by code completion. In other words, for example, there's no code completion for Groovy-specific things, just Java-specific things. (Where Groovy doesn't support something provided by Java, you'll still find code completion, etc, working for you, you'll just end up with compilation or runtime problems later. But these situations should be minimal.) You'll also find Java code templates working for you (e.g., type ir, press Tab, and then you'll have import). Plus, you'll find the extension to the Java Application project type for running groovyc and Groovydoc from Ant, as described in an earlier blog entry. And when you look in the Library Manager, you'll find the Groovy Library there (had to be a snapshot of 1.1, otherwise the Groovydoc script won't work).
Sometimes the Run menu item, in the editor, is disabled. Especially when you've first started up the IDE or first opened the editor. If that happens, you need to do something in the editor (e.g., add some code and save it) to enable the menu item. Again, no need to download the Groovy installation, because everything should be handled for you by the JSR 223 implementation. Feedback welcome.
The sources are available here: http://nbgroovysupport.dev.java.net/. Anyone is welcome to take them and add to them.
thats awesome.. thanks alot!
Great work, but I'm having one little issue so far.
Right-click->Run is disabled until I modify the editor. I open a groovy script, right-click on it and run is disabled. I click in the editor pane, hit space, ctrl-z (so no actual changes) then I can run.
Ok, I'm stupid, I didn't read until the end...I just got the link and went from there.
That's right. See the known issues on the plugin's page. I've encountered the same thing. Not sure how to fix it.
OK, no probs. :-) Any special wishes for the plugin? I mean, if there's one thing you'd like the next feature to be, what would it be>
Fantastic! Thanks!
Is it possible to use the debugger in Groovy code? I'm not able to set any breakpoints.
Yeah, what you need to do is set the breakpoint in a Java class, and let the Java class instantiate the Groovy class. (I have described that somewhere recently in this blog.) You also need to compile the Groovy script. Then when you debug the Java class, the Groovy script opens at the point where the Java class instantiates it. At that point, you can step through the Groovy script. So, it takes a bit of work to set up and it does mean that you need a Java class to kick off the debugger.
OK, I see. Thanks for the hint!