Discussion Locked

Bad documentation for remote debugging with Java 1.5

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm I the only one finding the documentation for remote debugging to be very bad. I couldn?t find the simple recipe to use remote debugging anywhere on the Web (yes I looked on Sun's Web site).
Whatever happened to the good old 1.4 recipe (using -Xdebug and -Xrunjdwp on the application VM side and the corresponding parameters on the debugger side).
If someone knows the recipe (parameters on the application VM side and debugger side) to do the equivalent with 1.5 I sure would appreciate reading it.

Thanks in advance
JS

7 replies

by nick

Jean,

I still use the following:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000

and it works fine with 1.5. I have done the same from a server and batch process and perfomr remote debugging through eclipse just like always.

Regards,
Nick

by pauln

I had to do a bit of fiddling to get mine to work in 1.5.

I'm using these switches on the application side (note this is on a Windows machine)

-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1441

I've used the NetBeans, Eclipse and JDeveloper debuggers successfully with this - just ensure the transport is the same (dt_socket in this example) and the port is the same (1441 in this example)

I don't know of any good documentation on this sorry.

Cheers
Paul
http://paulnorrie.wordpress.com

by jslarochelle

the -Xdebug and other options mentioned in my original post are nonstandard and in some cases deprecated (-Xdebug starting with 1.5).
With 1.5 the recommended parameter to use is the
-agentlib and associated parameters (see response by Nick for an example). And check the Java.exe documentation for details.
I knew about -Xdebug and associated parameters and I had used those in the past however when I saw in the documentation that the -Xdebug was deprecated in 1.5 I wanted to get information about the correct parameters to use and this is what frustrated me because while I could find a lot of detailed and low-level information about the new APIs (JVMTI versus JVMDI, etc...) I just could not find a single concrete example of a command line that I could use.
One thing that didn't help is the fact that I was probably subconciously looking for a switch with something like "debug" in it and -agentlib just did not register.

Thanks again for your response.
JS

by jslarochelle

and this should be useful to anyone trying to use the new parameters and switches.
We just could not put our fingers on this page when we did our search.
Using those links now anyone trying to use these VM options can go to the source and get the details.

Thanks again!
JS

by jslarochelle

I think that there is now enough information in this thread for anyone wanting to do remote debugging in Java 1.5 to get started.

Have fun programming in Java and good debugging.

JS

This discussion is closed to new replies.