Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a groovy script in eclipse

Tags:

eclipse

groovy

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

like image 949
Leikingo Avatar asked Jan 04 '11 13:01

Leikingo


People also ask

How do I run a Groovy script in eclipse?

Right-click the Groovy class, and select Run As Groovy Script from the context menu.

Can we write Groovy script in eclipse?

The Apache Groovy programming language allows for easy interoperability between the Java and Collibra libraries. To add support for Groovy syntax highlight and auto-completion in Eclipse: In the menu bar, click Help → Install New Software…. In the Available Software window, click Add.

How do I run Groovy test cases in Eclipse?

Please upgrade to the Alpha version of the groovy-eclipse plugin V2. You can run all unit tests in a project by right-clicking and selecting Run as->JUnit. In the new version of the plugin, Junit tests are treated identically whether they are written in Java or Groovy.


1 Answers

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

like image 150
Sean Patrick Floyd Avatar answered Sep 21 '22 06:09

Sean Patrick Floyd