1
votes

I just wanted to run quick groovy scratch file and now my Intellij is building my multi-module project because there are codegen tools and it feels like generating missing classes on each run is obligatory. But I just want to run the script, fast, that's why I used scripting language in first place!

I dont have a groovy compiler and cannot get it, so I have to use javac

And default configuration on Run is "java -Dmaven.allTheOptions etc" and I just want it to execute script when I press the hotkey

2
I use the Groovy Console built into the latest IntelliJ IDEA to try out quick groovy script constructs. It might work for you. Look for it under help / actions. - macg33zr
I cannot use any of those cool features because my world is not perfect - Denis Babochenko

2 Answers

1
votes

The answer is:

Run -> Edit Configurations... -> Defaults -> Groovy -> Before launch -> Press "Remove" on Build configuration

0
votes

Groovy can be built to a jar file, and run that way if you just have Groovy as a dependent library. If you want to run groovy as a script, I would use sdkman to download Groovy,so you can run it without compiling: https://sdkman.io/install

Alternatively you can download Groovy manually, and add it to your path like Java: http://groovy-lang.org/download.html

Once you have Groovy installed, you can run groovy scripts from the command line, or ues the groovyConsole.

I don't understand why you can't download Groovy, and have to use Javac.As macg33zr mentioned Intellij does have a Groovy console built-in, although I don't remember if it requires a Groovy install, but it probably does.