Specifying JVM parameters for Groovy Shell
I am wondering if it is at all possible to specify parameters for JVM instance running Groovy Shell. I found nothing similar in settings, to be more precise there are no settings for Groovy Shell at all.
Is Groovy Shell executed in separate JVM instance or using the one that IDEA uses itself?
请先登录再写评论。
Currently it's not possible to customize any VM parameters. Which ones do you want to change?
It's run in a separate JVM.
I need to set 'java.ext.dirs' which only has effect when set during VM launch. System.setProperty() does not work here.
Then I suggest you to create a normal Groovy script and run it using IDEA's run configuration where you can customize everything. Groovy Shell is really for very simple cases.
The thing is that I want to keep JVM running for quick execution of scripts. Initialization of the environment I am using takes a long time, so I cannot afford launching VM each time.
Then I'm afraid that currently Groovy Shell can't help you. You could file a feature request for such a customization, although I'd really avoid cluttering the UI with additional options. You may also build IDEA yourself and make the necessary changes to org.jetbrains.plugins.groovy.console.DefaultGroovyShellRunner#createJavaParameters. Finally, you could try running groovy.ui.GroovyMain or groovy.lang.GroovyShell (they have all sorts of command line parameters for interactive mode) via an Application run configuration and interact with them directly.
Thanks for a bunch of viable options!