0

I have a Windows service (that is, a native .exe) spawning the JVM, loading a bunch of JAR files and invoking their Java code.

How can I remotely debug the Java code running in the service process space?

Note: I tried to use the Java Control Panel to add the usual Runtime Parameters: -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4321,suspend=n but apparently these are not read by the spawned JVM, since the aforementioned port is not open on my system.

  • 1
    Which JDK version are you using? Seems like you are using wrong parameters. Look at this [answer](http://stackoverflow.com/a/22631355/2398521). – Maxim Jan 03 '17 at 22:43
  • Consider setting `suspend=y`. This will cause the JVM to pause until the debugger has connected to your JVM. – StvnBrkdll Jan 03 '17 at 22:50
  • Try `-agentlib:jdwp=transport=dt_socket,address=localhost:4321,server=y,suspend=n`, as indicated by link provided by @MaximDobryakov. And you need to tell the .exe to do that when *it* creates the VM. The Java Control Panel options don't apply there. How to tell the .exe depends on the .exe. – Andreas Jan 03 '17 at 23:20

0 Answers0