groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Suderman <>
Subject Re: Start shell/REPL without launching java monitor?
Date Mon, 15 Oct 2018 14:43:47 GMT
Hi Tison,

I am not sure what you are asking... groovysh is the "Groovy Shell" so you should see a terminal
window named "GroovyShell" launched that allows you to execute Groovy commands interactively.
 This is the expected behaviour.  Or are you just pointing out the exception when quitting
groovysh?  How did you kill groovysh?  With the Unix `kill` command (or Windows equivalent)
or using one of the "exit" commands in the shell itself (:exit, :x, etc)?

I suspect you may simply want the `groovy` command that you can use to run Groovy scripts/programs.

$ echo "println 'hello world'" > test.groovy
$ cat test.groovy
println 'hello world'
$ groovy test.groovy 
hello world

Hope this helps,

> On Oct 11, 2018, at 10:54 PM, Tzu-Li Chen < <>>
> Hi Groovy community,
> I am new to Groovy and when running `groovysh` with "3.0.0-alpha-3, JVM: 1.8.0_171" on
macOS, I see a, hmm, Java monitor(?), named "GroovyShell" launched.
> If I kill it, process `groovysh` quit with exception below. I'd like to know if we can
suppress the launch of "GroovyShell" process. It switch the focus of cursor and quite annoying
for me.
> Best,
> tison.
> [printStackTrace]:
> ➜  ~ groovysh
> Groovy Shell (3.0.0-alpha-3, JVM: 1.8.0_171)
> Type ':help' or ':h' for help.
> -------------------------------------------------------------------------------
> groovy:000> 2018-10-12 10:51:09.084 java[34387:1479007] java.lang.SecurityException:
Use of System.exit() is forbidden!
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> 	at java.lang.reflect.Constructor.newInstance(
> 	at org.codehaus.groovy.reflection.CachedConstructor.invoke(
> 	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(
> 	at
> 	at java.lang.Runtime.exit(
> 	at java.lang.System.exit(
> 	at
> 	at
> 	at$_QuitDispatcher.performDefaultAction(
> 	at$_AppEventDispatcher.dispatch(
> 	at

Keith Suderman
Research Associate
Department of Computer Science
Vassar College, Poughkeepsie NY

View raw message