I don't think that is something we currently allow.
I discussed this briefly with Mazz and one possibility we came up with is to create Server Plugin, deploy it into the server, and then have your script interact with that plugin. The server plugin can, I think, contain its own jars.
See here for more on server plugin development:
There is also a possibly relevant BZ here:
Thanks for the feedback. The alternative approach I decided to go with was have a Rhino script call a shell script, which invokes my Java code and performs my work. For example,
And in the shell script I can simply invoke Java (java -jar etc....). This seems to be doing the trick.
Great, Thanks for posting your solution.
If you have access to the RHQ server installation it should be possible to just add that jar to the server classpath - i.e. copy it either into the server's lib or in the lib of the rhq.ear.
I do believe I tried this and used importPackage(...) to try and include my library in the Rhino script, but without success. If this does indeed work, it is definitley a cleaner solution. However, since what I currently have is working I'm going to leave it as is for now. Thanks for the suggestion.