title: "Class not found" when runing feature with karate.jar
body: <p>I have a feature that execute a function from a Java class. So for this reason I use this command to get the class and create a new instance:</p>
  <p><a href="https://i.stack.imgur.com/oLIHl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oLIHl.png" alt="enter image description here" /></a></p>
  <p>When I run this feature with maven (mvn test -Dtest...) everything is okay. The problem is when I run this feature with karate standalone jar, karate can't find the RCNUtils class.</p>
  <p><strong>Error:</strong></p>
  <pre><code>org.graalvm.polyglot.PolyglotException: TypeError: Access to host class utilities.RCNUtils is not allowed or does not exist.
  </code></pre>
  <p><a href="https://i.stack.imgur.com/IFv97.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IFv97.png" alt="enter image description here" /></a></p>
  <p><strong>GraalJS error:</strong> <a href="https://github.com/oracle/graaljs/blob/master/docs/user/FAQ.md#typeerror-access-to-host-class-commyexamplemyclass-is-not-allowed-or-does-not-exist" rel="nofollow noreferrer">https://github.com/oracle/graaljs/blob/master/docs/user/FAQ.md#typeerror-access-to-host-class-commyexamplemyclass-is-not-allowed-or-does-not-exist</a></p>
  <hr />
  <p>I think it's a classpath problem but I have tried with a lot of differents paths and commands to execute the jar, and nothing works.</p>
  <p>I don't know if this is a known issue or if there is a karate example using utilities classes and executed with karate.jar</p>
  <blockquote>
  <p>I tested this problem with differents Karate versions. Actually I'm using Karate 1.1.0</p>
  </blockquote>
  <p><strong>Some of the options I have tried with no results:</strong></p>
  <ol>
  <li>Use -w / --workdir param to change working directory with no results</li>
  <li>Use java -cp instead of java -jar to set classpath following:
  <a href="https://stackoverflow.com/questions/58398742/unable-to-use-readclasspath-when-running-tests-with-standalone-karate-jar">Unable to use read(&#39;classpath:&#39;) when running tests with standalone karate.jar</a></li>
  <li>Use -Dkarate.config.dir param</li>
  </ol>
  <p>Note: I don't think it's a security problem because if I try to get &quot;RCNUtils.java&quot; file with &quot;karate.read()&quot; or &quot;read()&quot; in the same feature, it works. I think because I can put the path to the file. The problem is that I can't put the path to java class in &quot;Java.type()&quot; method</p>
  <p><strong>Same error here:</strong> <a href="https://stackoverflow.com/questions/56456840/executing-karate-jar-with-mock-using-external-library-spring-framework/56458094#56458094">Executing Karate jar with mock using external library Spring Framework</a></p>
  <p>Thanks in advance.</p>