https://kotlinlang.org logo
n

nickheitz

04/13/2021, 8:53 AM
Can anyone recommend a tool that allows you to attach a kotlin repl to an already running JVM process? As the target environment is CLI only, intellij wouldn't be a choice. I'm looking for something like scalive for scala or liverepl for clojure.
n

nanodeath

04/13/2021, 4:09 PM
why wouldn't IntelliJ be a choice?
n

nickheitz

04/13/2021, 6:18 PM
My target would be a k8s container running in a remote cluster. If I can exec into the remote container, then is like to interrogate a running JVM using some kind of repl. The ones I've used before utilise the Java attach api, so don't even require a debug agent. Can intellij do that remotely? I wasn't aware of such a feature..
n

nanodeath

04/13/2021, 6:31 PM
if you can do remote port forwarding, or just open up a specific port on the cluster...I'd think the JVM can connect, regardless of whether it's IntelliJ, JVisualVM, or something else
k8s containers are 100% outside of my wheelhouse though 🙂
n

nickheitz

04/13/2021, 6:39 PM
Fair enough. I think that covers remote debugging, certainly... I misspoke earlier. I didn't mean the activation framework, I meant the Java Attach API. I've corrected. https://docs.oracle.com/javase/7/docs/technotes/guides/attach/index.html#:~:text=The%20Attach%20API%20is%20a,agent%20into%20that%20virtual%20machine.
4 Views