Geertjan's Blog

  • October 25, 2007

Groovy in Plugin Portal

Geertjan Wielenga
Product Manager
I've been squirriling away some Groovy editor support for a while. Today I put it all on a site I had requested sometime ago. It's not necessarily much, but gets the job done, basic syntax coloring, a file template, and a run script action via JSR 223 (hence you need JDK 6). Go here:


I intend to continue squirriling, bit by bit, as time goes by. But there's definitely enough there already for the absolute basics. After installing the three NBMs in the ZIP file referred to above, you'll have a file template:

When you finish the wizard above, you'll be able to run scripts (right-click in the editor and choose Run Groovy Script), with the results typically in the Output window:

By the way, using the technique shown a few days ago, you can continue stepping through Groovy to your heart's content:

If you don't like the fonts and colors I chose for you, go to the Options window, to the Fonts & Colors tab, to change them:

Use these three NBM files at your own risk. Possibly it will destroy everything you've ever believed in. Or maybe just your IDE, which is probably worse. So be careful. It has not been tested, I created it on a post-6.0 Beta 2 build on Ubuntu, so possibly you won't even be able to install it. I would be interested to know what people think of it.

Join the discussion

Comments ( 11 )
  • Pan Feng Thursday, October 25, 2007

    Dear Geertjan,

    I can not install the three plugin file.

    The warning message is:

    Missing required modules for plugin GroovySupport:

    module org.openide.util >

    Environment: NetBeans 6.0 Beta 2+JDK 6.02

  • Claus Hausberger Thursday, October 25, 2007

    I have the same problem. Netbeans beta 2, JDK 6.03 on Windows.


  • Geertjan Thursday, October 25, 2007

    Thanks for the message Pan and Claus! AFAIK, this should now be fixed. Go back to the plugin portal and download the ZIP again, I uploaded a new one that I tried our on Beta 2.

  • Geertjan Friday, October 26, 2007

    Wait, I spoke too soon. Doesn't work on Beta 2 yet. Fixing now.

  • Geertjan Friday, October 26, 2007

    Still a problem where the Run Groovy Script menu item isn't always enabled. Working on that.

  • Pan Feng Friday, October 26, 2007

    FYI, now the plugin has been install successfully.

    And I ran a simple groovy script correctly.

    Thanks for your effort.

  • Geertjan Friday, October 26, 2007

    Wow, great news Pan. Thanks!

  • Stefan Friday, October 26, 2007

    Great news, keep up this good work! Now I don't need to start Eclipse anymore just for editing Groovy scripts.

    BTW: The "Run Groovy script" menu item is always disabled for me.

  • Geertjan Friday, October 26, 2007

    Hmm. That's strange. I wonder what's different about Pan's installation, because he doesn't have this problem. You can also get the sources here and see if they work for you:


  • Georg Friday, October 26, 2007

    Hi Geertjan,

    this is really perfect timing, because just a few days ago I bought the "GinA" book and the only thing that kept me from working my way through it was the missing Groovy support in NetBeans.

    With the latest daily (24.10.2007) the Run Groovy script entry is enabled.

    By the way, do you happen to know what the Groovy Editing Support module should provide that I can see in Available Plugins (I installed it, but I could not find any Groovy support after that, quite contrary to your module :)).




  • Geertjan Saturday, October 27, 2007

    Brilliant. You've made my day, Georg! (About that other plugin -- it doesn't work for me either, although it used to, and when it did it provided only coloring for strings and keywords, which was already a lot better than nothing, but I don't know why it's stopped working.)

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.