On Mar 7, 5:58 pm, Boris Reitman <[EMAIL PROTECTED]> wrote:
> I can't executed the simplest unique.js in samples.
>
> [EMAIL PROTECTED]:~/tmp/rhino1_6R7/examples$ ~/bin/rhino unique.js
> js: Class "File" not found.
> js: org.mozilla.javascript.EvaluatorException: Class "File" not found.
> [EMAIL PROTECTED]:~/tmp/rhino1_6R7/examples$ ja
> [EMAIL PROTECTED]:~/tmp/rhino1_6R7/examples$ cat ~/bin/rhino
> #!/bin/sh
>
> /home/boris/SDK/jdk/bin/java -jar /usr/share/java/js.jar $@
>
> [EMAIL PROTECTED]:~/tmp/rhino1_6R7/examples$ echo $CLASSPATH
> .:/usr/share/java/js.jar:
> [EMAIL PROTECTED]:~/tmp/rhino1_6R7/examples$ ls -l File.class
> -rw-r--r-- 1 boris boris 4748 2008-03-07 17:57 File.class
>
> I could have probably messed up my class path, but I can' figure out
> how.  Must be something really obvious.

The example code isn't compiled in the distribution, so you'll have to
compile it:

[rhino] cd examples
[examples] javac -cp js.jar File.java
Note: File.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.   // gotta fix
that...
[examples] cat data
a
b
c
b
d
e
a
c
[examples] java -cp 'js.jar;.' org.mozilla.javascript.tools.shell.Main
unique.js data
c
d
e
a
b

Note how I have to add the current directory (which contains
File.class) to the classpath. I used my Windows laptop rather than my
normal Linux since it's the weekend :-)

--N
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to