title: Call a class of a jar from SSJS xPages
body: <p>I would like to ask a question about using Java classes in SSJS (Server Side JavaScript) on xPages. I created a simple Java class "HelloWorld" and exported it to a jar file. Then I tried to call it from SSJS on an xPage but with no success. These are some things that I tried:</p>
  
  <ol>
  <li>Added the jar to the build path of the .nsf (both jar and nsf were local)</li>
  <li>Added the jar to WEB_INF/lib folder of the nsf.</li>
  <li><p>Called the class of the jar directly from SSJS as</p>
  
  <p>var a = new com.myself.testJava.HelloWorld();</p></li>
  <li><p>Called the class from another Java class that I created in the nsf and then call the second class from SSJS. </p></li>
  </ol>
  
  <p>I always get an error 500 "HTTP Web Server: Command Not Handled Exception"</p>
  
  <p>I have also tried to run my xpage on a server and add the jar file to the jvm/lib/ext folder. In this case the error was "com" not found, which I understand that it means that the class cannot be found. </p>
  
  <p>I have accomplished to create a java class in the nsf and then call from SSJS, but I want to be able to use 3rd party classes. </p>
  
  <p>Could you please give any information about what are the correct steps?</p>
  
  <p>Thanks a lot in advance!</p>