Subj : Rhino Outputting To : netscape.public.mozilla.jseng From : Ronald Kent Gibson Date : Thu Mar 04 2004 02:59 pm Dear All, Are there any commands supported in rhino where the javascript can output the value of a variable?. Maybe I am just too much of a newbie and some concept is missing, however this is what I want to do, I want to compile a javascript program into java and I want the javascript program to output some values, for example: x = 1; y = 2; z = x + y; document.write(z); or x = 1; y = 2; z = x + y; alert(z); both compile ok but I get runtime errors: Exception in thread "main" ReferenceError: "document" is not defined. at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.ja a:2257) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.ja a:2247) at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1256) at xpluyy._c0(Unknown Source) at xpluyy.call(Unknown Source) at xpluyy.exec(Unknown Source) at org.mozilla.javascript.ScriptRuntime.main(ScriptRuntime.java:2086) at xpluyy.main(Unknown Source) E:\Programme\eclipse\workspace\Rhino>java org.mozilla.javascript.tools.jsc.Main xpluyy.js E:\Programme\eclipse\workspace\Rhino>java xpluyy Exception in thread "main" ReferenceError: "alert" is not defined. at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.ja a:2257) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.ja a:2247) at org.mozilla.javascript.optimizer.OptRuntime.callSimple(OptRuntime.ja a:253) at xpluyy._c0(Unknown Source) at xpluyy.call(Unknown Source) at xpluyy.exec(Unknown Source) at org.mozilla.javascript.ScriptRuntime.main(ScriptRuntime.java:2086) at xpluyy.main(Unknown Source) am I doing something stupid? thanks kent .