title: Can't get Janino compiler to compile files in same directory as jar
body: <p>I'm using Janino to compile java files at runtime to use in a program. I'm using netbeans and I can only get it to compile at runtime when I put the directory in the src folder. If I try to compile it using relative paths It won't work.</p>
  
  <p>I'm following the example at <a href="http://docs.codehaus.org/display/JANINO/Advanced#Advanced-compiler" rel="nofollow">http://docs.codehaus.org/display/JANINO/Advanced#Advanced-compiler</a> </p>
  
  <p>Here's what works when i put the files to be compiled at runtime in a folder called scripts in the src directory:</p>
  
  <pre><code>        String engineClass = "DefaultEngine"; //name of engine class
          String guiClass = "DefaultGUI"; // name of gui class
          ClassLoader cl = new JavaSourceClassLoader(
                  this.getClass().getClassLoader(),
                  new File[]{new File("scripts")},
                  (String) null,
                  DebuggingInformation.NONE);
          AbstractEngine engine = (AbstractEngine) cl.loadClass(engineClass).newInstance();
          AbstractGUI gui = (AbstractGUI) cl.loadClass(guiClass).newInstance();
  </code></pre>
  
  <p>It doesn't work if I put the scripts folder in the same directory as the jar.
  I can only get it to work when I run the project from inside the IDE with the scripts folder in the src directory.</p>
  
  <p>When I try running the project using the scripts folder in the same folder as the jar file it gives a ClassNotFoundException on the 
  <code>AbstractEngine engine = (AbstractEngine) cl.loadClass(engineClass).newInstance();</code> line</p>