s-u / rJava

R to Java interface
https://RForge.net/rJava
235 stars 77 forks source link

Is remote Java debugging supported? #326

Closed marie-r closed 6 months ago

marie-r commented 6 months ago

Dear All,

I'm attempting to attach a remote debugger to an Java process running under rJava.

I ran .jinit as follows:
`

Start JVM with remote debug listening port

.jinit("-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n") ` and attempted unsuccessfully to attach to port 8000 via Eclipse. I'm running R 4.4.0 (Puppy Cup), rJava 1.0-11, RStudio 2024.04.0, and OpenJDK 21.0.1. Launching OpenJDK from the command line with the -agentlib string and a random jar does allow me to connect. I suspect that either .jinit is not passing through the string (feature enhancement request?) or there is a pilot error on my part.

Thanks for reading the question, any suggestions would be appreciated. Marie

marie-r commented 6 months ago

This was a pilot error on my part. I did not see that it there is a parameters keyword argument that I should have been using: .jinit(parameters="-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n") Regards - Marie