title: Get reference to Class from another class loader at runtime in JAVA
body: <p>I am running some domain specific scripts in a new thread of an application. The classloader in the thread only has all the classes of the application.</p>
  
  <p>The application also has a module that loads additional classes in jars in a folder at runtime (classes created outside of the application), providing additional functionalities to other parts of the application.</p>
  
  <p>Unfortunately, these two classloaders are not merged and when running my scripts I cannot load any class that I know is there in one of the external jars.</p>
  
  <p>Tried <code>this.getClass().getClassLoader().loadClass("external.cls")</code> no go. </p>
  
  <p>I also tried <code>Reflections reflections = new Reflections("external.cls")</code> without success. </p>
  
  <p>Is there a way to gain access to those classes in my script running thread at runtime? Something like:</p>
  
  <ul>
  <li>Gain access to another class loader that loaded the external class?</li>
  <li>Use reflection to get the external class from the two class loaders?</li>
  <li>Load the external jars again in my script running thread?</li>
  </ul>