title: Scala object import from another script loaded using Java ScriptEngine gives an error
body: <p>I have a Scala object like below</p>
  
  <pre><code>object Loader{
    //Implementation
  }
  </code></pre>
  
  <p>Then I have another Scala script which is loaded by a Java application using ScriptEngine.</p>
  
  <pre><code>import Loader
  
  class Activity {
    //Implementation
  } 
  
  new Activity()
  </code></pre>
  
  <p>I use below code to get a compiled script of above class.</p>
  
  <pre><code>ScriptEngine engine = new ScriptEngineManager().getEngineByExtension("scala");
  
  FileReader fr = new FileReader(file)
  compilable = (Compilable)engine
  compiledScript = compilable.compile(fr);
  </code></pre>
  
  <p>When I do the above I get following error.</p>
  
  <blockquote>
    <p>. expected in [code of Activity class]</p>
  </blockquote>
  
  <p>Is there a way I can make the import mentioned above?</p>