I understand ClojureScript can be executed within a JavaScript REPL or it can be compiled into JavaScript, then run in a browser. I couldn't find a way to use it on the server side with Rhino. Here is my way of thinking, I have a simple source file:
(ns simple.hello)
(println "Hello, world")
I compile it to hello.js
. I try to run
java -jar js.jar out/goog/base.js out/goog/deps.js out/hello.js
Nothing happens. How can I make it work, or is only Node.js supported on the command line?
This works for me:
src/app.js:
To compile:
Then, to run with Rhino:
Output: Hello World
Hope that helps!