java - How do I add a .jar file to Rhino's classpath? -


i scripting java via rhino, , use jcodec library. put jcodec-0.1.9.jar file in same directory, , added via -cp on command-line. command invoke rhino looks like:

java -cp "rhino-1.7.7.1.jar;jcodec-0.1.9.jar;." org.mozilla.javascript.tools.shell.main -opt 9 js/main.js %*  

however, library doesn't load @ all, since of classes remain undefined. example, running:

print(java.lang.class.forname('org.jcodec.api.awt.sequenceencoder')) 

throws classnotfoundexception, while doesn't say, 'javax.swing.jframe'.

i feel i'm not including correctly, everywhere i've looked, seems way. have suggestions?

try following make sure current directory in classpaht:

java -cp ".\rhino-1.7.7.1.jar;.\jcodec-0.1.9.jar;." org.mozilla.javascript.tools.shell 

note: if you're on unix change .\ ./ , ; :

updated:

the class trying reference not have 'awt' in it. should be:

  org.jcodec.api.sequenceencoder 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)