I have a java project A which is dependent on another project B. I want to debug the java class of project B while starting the batch files from project A. How can I achieve this in Eclipse ?
Asked
Active
Viewed 1,031 times
-1
-
This is very vague. Why can't you just start the batch files, and then select Debug As on Project B in Eclipse? – Steve Smith Mar 03 '17 at 13:35
1 Answers
4
You can attach tell java to allow connecting to debug by passing the command line parameters (legacy style):
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
The newer style (JVM TI interface used):
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
You should then be able to attach eclipse to debug:
Configure Eclipse for remote debugging by specifying host and port. host: localhost, port:8000
See this answer: What are Java command line options to set to allow JVM to be remotely debugged?