title: Groovy shell horrendously slow to start
body: <p>I'm running the interactive <a href="http://groovy.codehaus.org/Groovy+Shell" rel="nofollow">Groovy Shell</a> and it's literally taking <strong>minutes</strong> to start on my machine (a Windows 7 laptop with an Intel i5 processor and 4 GB of RAM so not an ancient computer, just a middle of the road one)</p>
  
  <p>Running simple scripts using <code>groovy</code> or <code>groovyclient</code> and <code>groovyserver</code> takes an acceptable amount of time (several seconds tops) but after running <code>groovysh</code> the cursor just starts blinking for... long enough for me to make tea, write this very question and rant about this on Twitter (and still no prompt to write any code)</p>
  
  <p>Tried this with the following configurations</p>
  
  <blockquote>
    <ul>
    <li>Groovy Version: 2.3.4 JVM: 1.7.0_03 Vendor: Oracle Corporation OS: Windows 7</li>
    <li>Groovy Version: 2.3.4 JVM: 1.8.0_20 Vendor: Oracle Corporation OS: Windows 7</li>
    </ul>
  </blockquote>
  
  <p>and it's exactly the same.</p>
  
  <p>I'd really like to be able to use it in a REPL style. Has anyone faced and solved similar problems? Can you recommend a different tool for the job?</p>
  
  <p>As suggested in the comments, I ran <code>groovysh -d -v</code> to enable debug and verbose output, in hope of seeing what takes such a long time.</p>
  
  <h2>Output of <code>groovysh -d -v</code></h2>
  
  <pre><code>DEBUG [org.codehaus.groovy.tools.shell.BufferManager] Created new buffer with index: 0
  DEBUG [org.codehaus.groovy.tools.shell.BufferManager] Buffers reset
  DEBUG [org.codehaus.groovy.tools.shell.Parser] Using parser flavor: rigid
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: ?
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :help
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :quit
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :exit
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: import
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :display
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :clear
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :show
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :inspect
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :purge
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :edit
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: .
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :load
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :save
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :record
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :history
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :alias
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :set
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :register
  DEBUG [org.codehaus.groovy.tools.shell.CommandRegistry] Registered command: :doc
  </code></pre>
  
  <p>For a very long time, no further output and then the whole rest in a matter of seconds:</p>
  
  <pre><code>DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Terminal (jline.AnsiWindowsTerminal@66f57048)
  DEBUG [org.codehaus.groovy.tools.shell.Groovysh]     Supported:  true
  DEBUG [org.codehaus.groovy.tools.shell.Groovysh]     ECHO:       (enabled: false)
  DEBUG [org.codehaus.groovy.tools.shell.Groovysh]     H x W:      41 x 169
  DEBUG [org.codehaus.groovy.tools.shell.Groovysh]     ANSI:       true
  DEBUG [org.codehaus.groovy.tools.shell.Groovysh]     Direct:     true
  DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Using history file: C:\Users\Tomek\.groovy\groovysh.history
  Groovy Shell (2.3.4, JVM: 1.8.0_20)
  Type ':help' or ':h' for help.
  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[1] for command: :help
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[2] for command: ?
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[3] for command: :exit
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[4] for command: :quit
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[5] for command: import
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[6] for command: :display
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[7] for command: :clear
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[8] for command: :show
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[9] for command: :inspect
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[10] for command: :purge
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[11] for command: :edit
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[12] for command: :load
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[13] for command: .
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[14] for command: :save
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[15] for command: :record
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[16] for command: :history
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[17] for command: :alias
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[18] for command: :set
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[19] for command: :register
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Added completer[20] for command: :doc
  DEBUG [org.codehaus.groovy.tools.shell.CommandsMultiCompleter] Refreshing the completer list
  DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Running
  groovy:000&gt;
  </code></pre>