title: Getting a TypeError: wrong argument type Array (expected Module) with include java_import
body: <p>I'm just starting using JRuby and when I test following code saved as a script</p>
  
  <pre><code>include java_import
  frame = javax.swing.JFrame.new
  frame.getContentPane.add javax.swing.JLabel.new('Hello, World!')
  frame.setDefaultCloseOperation javax.swing.JFrame::EXIT_ON_CLOSE
  frame.pack
  frame.set_visible true
  </code></pre>
  
  <p>I get the following error</p>
  
  <pre><code>Switch to inspect mode.
  irb(main):001:0&gt; include java_import
  TypeError: wrong argument type Array (expected Module)
      from org/jruby/RubyModule.java:2068:in `include'
      from (irb):1:in `evaluate'
      from org/jruby/RubyKernel.java:1066:in `eval'
      from org/jruby/RubyKernel.java:1392:in `loop'
      from org/jruby/RubyKernel.java:1174:in `catch'
      from org/jruby/RubyKernel.java:1174:in `catch'
      from C:\jruby-1.7.2\/bin/jirb_swing:54:in `(root)'
  irb(main):002:0&gt;
  </code></pre>
  
  <p>Can someone help me identify what I'm doing wrong? I have jruby-1.7.2 installed (C:\jruby-1.7.2), added to the PATH in system variables, and running on Windows 7. At the command prompt, I can test jruby and java version correctly</p>
  
  <p>I also launched the jirb_swing via jruby(1.9.3).exe and at the prompt typed </p>
  
  <pre><code>irb(main):001:0&gt; include java_import 
  </code></pre>
  
  <p>and I get the same error message</p>
  
  <p><strong>Update</strong></p>
  
  <p>Hi All</p>
  
  <p>After searching further on the Internet pages on JRuby and Java, I have resolved the problem successfully.</p>
  
  <p>First the two ways that worked for me in calling Java from JRuby:</p>
  
  <ol>
  <li>Using "include Java" (without the quotes in my script file and with capital J)</li>
  <li>Using "require 'java'" (without the " quotes and notice the single quotes around java, now starting with lower-cap j) </li>
  </ol>
  
  <p>The "java_import" I was using was an error on my part in being careless as I read the detailed document at GitHub (<a href="https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby" rel="nofollow">https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby</a>)</p>
  
  <p>I will research more about the differences or lack thereof in using the "include" vs. "require" statements and post back. As a real novice, this has been a real eye opener</p>
  
  <p>Sri</p>