gamejs build.sh java error on OSX / choice of Java constructor write matching JavaScript argument types in ambiguous

38 views
Skip to first unread message

Joel Schaubert

unread,
Apr 7, 2013, 6:11:34 PM4/7/13
to gam...@googlegroups.com

Just found gamejs a couple of days ago.
Library looks awesome, the fact that it has simple example app rocks.

When I tried to run ./bin/build.sh on Mac OSX I get this java error

JoelS$ ./bin/build.sh
js: The choice of Java constructor write matching JavaScript argument types ([B) is ambiguous; candidate constructors are:
    void write(byte[])
    void write(int)
js: org.mozilla.javascript.EvaluatorException: The choice of Java constructor write matching JavaScript argument types ([B) is ambiguous; candidate constructors are:
    void write(byte[])
    void write(int)
Wrote gamejs/gamejs.min.js

And my gamejs/gamejs.min.js  is zero bytes.

Looking at ./bin/build.sh   I'd say the problem is while executing this line
EXEC_YABBLER="${java_cmd} -jar ${GAMEJS_HOME}/utils/rhino/js.jar ${GAMEJS_HOME}/utils/yabbler/yabbler.js"


JoelS$ java -version
java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)


Checking rhino's version, its pretty close to the current release
oelS$ unzip -p ./utils/rhino/js.jar META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 16.0-b13 (Sun Microsystems Inc.)
Main-Class: org.mozilla.javascript.tools.shell.Main
Implementation-Version: 1.7R2
Implementation-Title: Mozilla Rhino 1.7R2
Implementation-Vendor: Mozilla Foundation
Implementation-URL: http://www.mozilla.org/rhino


Grabbing the latest 1.7R4 from
https://developer.mozilla.org/en-US/docs/Rhino/Download_Rhino
and replacing js.jar does not change the error


Anybody run into and fixed this error before?

Thanks,
Joel

p.s.  If you can't get ./bin/build.sh to run, you can still run the examples by hacking around.
Goto  each  example/javascript directory  and do a
cp -r ../../lib/gamejs* .
And the examples will then run even without getting build.js to create gamejs.min.js





si...@nekapuzer.at

unread,
Apr 8, 2013, 3:24:37 AM4/8/13
to gam...@googlegroups.com
thank you for reporting this. I assume you are using git master?

>
> JoelS$ ./bin/build.sh
> js: The choice of Java constructor write matching JavaScript argument types

It's certainly a problem with yabbler where I use java.io.StringWriter.write() multiple times.

By adding the "-debug" option to rhino we should get more useful output:

EXEC_YABBLER="${java_cmd} -jar ${GAMEJS_HOME}/utils/rhino/js.jar -debug ${GAMEJS_HOME}/utils/yabbler/yabbler.js"

This should give us a line number to work with. If you are super motiviated, you could `console.log` the arguments
we are passing to `write()` at that line and we should be close to a solution :)

simon

Simon Oberhammer

unread,
Apr 9, 2013, 2:57:41 AM4/9/13
to gam...@googlegroups.com
joel & I debugged it some more and it's now fixed in git master

 simon

Joel Schaubert

unread,
Apr 9, 2013, 11:30:12 PM4/9/13
to gam...@googlegroups.com
YES !
Confirmed working from head.

Great work Simon,
thanks for the prompt replies.
Really looking forward to trying out gamejs.
I have years and years of experience coding back ends of systems but very little UI experience so this will make a nice side hobby.

Joel



--
You received this message because you are subscribed to a topic in the Google Groups "GameJs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gamejs/FpkvEiBKJns/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to gamejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages