http://gorilla3d.com/home/gorilla3d/jstest.zip

The whole point of this is to let me use ACMEBicycle as a class. So i
tried:

for(i in com.gorilla3d.ACMEBicycle) {
    print(i);
}

and it returns:

getTopLevelScope
DONTENUM
objectPrototype
deleteProperty
callMethod
defineProperty
functionPrototype
propertyIds
topLevelScope
PERMANENT
NOT_FOUND
redefineProperty
EMPTY
defineConstProperty
getObjectPrototype
getTopScopeValue
getProperty
defineClass
property
hasProperty
topScopeValue
getDefaultValue
defaultValue
UNINITIALIZED_CONST
classPrototype
CONST
main
getPropertyIds
getClassPrototype
putProperty
READONLY
getFunctionPrototype
putConstProperty

All I can do with this is run com.gorilla3d.ACMEBicycle.main
(['test']). I have no access to the functions I created in the script.
This was why i was trying with -implements

I am trying to use rhino to create a reusable class from a javascript
file, however when I tried:

$ rhino-jsc -implements com.gorilla3d.Bike -package com.gorilla3d com/
gorilla3d/ACMEBicycle.js
Exception in thread "main" java.lang.Error:
java.lang.ClassNotFoundException: com/gorilla3d/Bike
        at org.mozilla.javascript.tools.jsc.Main.processOptions(Main.java:
219)
        at org.mozilla.javascript.tools.jsc.Main.main(Main.java:62)


So my guess is it cant find it? I jar everything up:
main.js
------------------------------------------------------------
importPackage(com.gorilla3d);
new Bike();
------------------------------------------------------------
$ java -cp js.jar org.mozilla.javascript.tools.shell.Main main.js
js: error instantiating (0): class com.gorilla3d.Bike is interface or
abstract

Ok so it atleast finds it in the shell, lets try the jsc:
$ java -cp js.jar org.mozilla.javascript.tools.jsc.Main -implements
com/gorilla3d/Bike -package com.gorilla3d  com/gorilla3d/
ACMEBicycle.js
Exception in thread "main" java.lang.Error:
java.lang.ClassNotFoundException: com/gorilla3d/Bike
        at org.mozilla.javascript.tools.jsc.Main.processOptions(Main.java:
219)
        at org.mozilla.javascript.tools.jsc.Main.main(Main.java:62)


So now im stuck, am i doing something wrong?
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to