How can I run javascript/rhino implementation on cldc?

129 views Asked by At

I'm trying to implement the javascript/rhino implementation on cldc through this api:

http://sourceforge.net/projects/rhinoj2mecldc/

I downloaded the project and created a new one in netbeans adding all sources, the application runs without errors and I can eval single expresions like "5+6", the problem is when I try to use java objects:

I have trying with this but all throws exception:

var v = new Packages.java.lang.String("hi"); // org.mozilla.javascript.EcmaError:     ReferenceError: "Packages" is not defined.
var v = new java.lang.String("hi"); // org.mozilla.javascript.EcmaError: ReferenceError: "java" is not defined.
var v = new java.util.Date(); // org.mozilla.javascript.EcmaError: ReferenceError: "java" is not defined.

any of you know if this implementation of rhino supports java objects? If so, how I can make it work? Thanks

0

There are 0 answers