Probably the easiest way to run the script launcher. If you are using * nix or OS X, you can put the shell script in the same directory as all of your Javascript, which changes the directory to your script directory before running:
#!/bin/sh
cd `dirname "$0"`
java -jar js.jar your_script.js
If your script should be running in the current user directory, you can instead wrap its location on the command line:
#!/bin/sh
DIR=`basename "$0"`
java -jar "$DIR/js.jar" "$DIR/loader.js" "$DIR"
Then, in loader.js, use the Rhino builtin argument variables to access "$ DIR":
load(arguments[0] + "/another_js_file.js");
Rhino features are documented here .
Windows; CMD.EXE.