-1

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 ?

Squashman
  • 13,649
  • 5
  • 27
  • 36
  • 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 Answers1

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?

Community
  • 1
  • 1
James
  • 1,095
  • 7
  • 20