Any news on this?  I'm also interested in getting clojure to work in
an applet.  Right now, I'm testing out the feasibility of developing a
clojure applet for the Facebook platform (a game).  I assume that a
certificate will solve the permissions problem, but for now I'm
running it locally with a totally permissive policy file /usr/lib/jvm/
java-6-openjdk/jre/lib/security/java.policy

Doing this allows me to get past the permissions issues, but here is
the error that I get now:

Error loading/compiling cljsrc file: java.lang.Exception: Unable to
resolve symbol: import in this context (NO_SOURCE_FILE:3)
java.lang.Exception: Unable to resolve symbol: import in this context
(NO_SOURCE_FILE:3)

I'm using the code that Bill Robinson posted earlier, and getting this
error.  Does anyone know what might be the cause of this?

Thanks,
Rob

On Feb 23, 9:58 am, William Robinson <[EMAIL PROTECTED]> wrote:
> Using the 2008-02-13 release, I've been trying to see if I could get
> Clojure working via an applet. I've attached my java stub, (bad) html
> and clj file. This applet should basically just dispatch the key
> functions to the clojure. I'm not sure about the file readers (bit rusty
> on java), but it's failing on the RT.init() call...
>
>  > javac -classpath clojure.jar ClojureAppletTest1.java
>  > appletviewer ClojureAppletTest1.html
> Couldn't initialize Clojure runtime: Pop without matching push
> java.lang.IllegalStateException: Pop without matching push
>         at clojure.lang.Var.popThreadBindings(Var.java:224)
>         at clojure.lang.RT.init(RT.java:224)
>         at ClojureAppletTest1.init(ClojureAppletTest1.java:22)
>         at sun.applet.AppletPanel.run(AppletPanel.java:419)
>         at java.lang.Thread.run(Thread.java:619)
>
> Any ideas appreciated.
> Regards
> Bill.
>
> [ClojureAppletTest1.clj< 1K ](in-ns 'applet)
>
> (import '(java.applet Applet)
>         '(java.awt Graphics))
>
> (defn paint [applet g]
>   (. g (setColor (. Color BLUE)))
>   (let [width (. applet getWidth)
>         height (. applet getHeight)]
>     (. g (drawRect 1 1 (- width 2) (- height 2)))
>     (. g (drawString (+ "A Clojure applet!"
>                         ((new Integer width) (toString))
>                         "x"
>                         ((new Integer height) (toString)))
>                      2 15))))
>
> [ClojureAppletTest1.html< 1K ]
>
>  ClojureAppletTest1.java
> 2KViewDownload

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to