The command you used attempts to run r.js
with main.js
as the entry point, not perform optimization (bear in mind the Optimizer is not the main component of r.js
). You probably found the command in the r.js README; the correct command is in the same file, in the "Optimizer" section:
java -classpath path/to/rhino/js.jar;path/to/closure/compiler.jar org.mozilla.javascript.tools.shell.Main r.js -o path/to/buildconfig.js
You'll need a build profile file which should be fairly straightforward in your case. More info directly on RequireJS page.
I can highly recommend using Node.js
instead of Rhino, it's much faster and saves setting up Java dependencies/classpath.