I have an API in a jar file but how can I use the classes from the jar in JavaScript? When I try importing them,
conf = Packages.abcapi.Config; var cfg = new conf.Config(); It doesn't work. This is not going to be used in a browser or over the internet.
UPDATE:
I'm extending our API to all JSR-223 Scripting Languages using Java ScriptEngine. Inside the Java application I read a JavaScript File and then execute the file using ScriptEngine. I need for the JavaScript File to use classes from the API which lays in a jar file. I try setting the jar in the classpath when running the ScriptEngine but it still doesn't find the classes using the above code. This works fine in Jython though, as in Jython has no problem using the classes in the jar file after setting the jar in the class path.
importwith regard to what you tried and definedoesn't work