Reputation: 940
I'm currently writing some groovy scripts. Till now I simply use notepad and run the scripts via groovy script.groovy
. But I'm looking some help for editing the files. So I tried eclipse with the groovy plugin which looks great...for groovy projects. But I just want to edit and run the groovy scripts. No Project dir etc.. What's the best way to handle scripts in eclipse. I don't want to package the files to jars or something like that. I have just a folder with some scripts in it... No src/bin directory or subfolders for package names. Is that possible?
Thanks, Ingo
Upvotes: 16
Views: 35681
Reputation: 4695
This solution still requires a "project", but aims to use Eclipse to do it in the least invasive way.
Then you can use the "run as" as stated by Mr. Floyd :D
Upvotes: 0
Reputation: 187399
It sounds like Eclipse is a bit heavyweight for your needs, have you considered using the GroovyConsole instead? It's a very simple Groovy IDE, available in the Groovy bin
directory. Assuming you have this directory on your PATH
, you can start it by running groovyConsole
from the command line.
Useful shortcuts are:
Upvotes: 3
Reputation: 299218
You must convert your project to a Groovy project (right-click project: Configure > Convert to Groovy Project
), but then, sure, it's possible.
When editing a .groovy
file, select Run > Run as ... > Groovy Script
Upvotes: 16