Attach a clojure / scala repl to a running JVM

前端 未结 4 779
花落未央
花落未央 2021-01-31 09:54

I have a java web application running under tomcat in a Sun java 6 JVM. Is there a way to attach a scala or clojure REPL to the running JVM ?

Once the webapp is up and

4条回答
  •  执笔经年
    2021-01-31 09:57

    There's no way to attach a REPL to an already-running JVM, so you need to think about the problem backwards...

    Start the REPL on the server, either when the program is launched or in response to a inbound client connection (using e.g. Telnet).

    There's a good example here: http://blog.homecloud.ca/2010/03/scripster-interactive-scala-repl-using.html

    You could also host an Interpreter instance in your server, then expose a web interface. This is the approach taken by http://www.simplyscala.com/


    If you're thinking of debugging, then you'd be better served by this answer: Drop into interpreter during arbitrary scala code location

提交回复
热议问题