开发者

Invoking debug session in Eclipse outside Eclipse

开发者 https://www.devze.com 2023-01-01 12:10 出处:网络
How 开发者_开发问答to run debugging session in Eclipse but to invoke it outside Eclipse (instead of doing Run->Debug I want to invoke some process (maybe jdb?) that will start debug in Eclipse). Is th

How 开发者_开发问答to run debugging session in Eclipse but to invoke it outside Eclipse (instead of doing Run->Debug I want to invoke some process (maybe jdb?) that will start debug in Eclipse). Is that possible?


As illustrated by this thread, it is possible through remote debugging (see remote debugging).
I.e: it won't automatically launch Eclipse for you. You have to launch an Eclipse session and listen to the port used for remote debugging.

Well I just tried running a program from an Ant buildfile and then connected to it with Eclipse..worked great.
My test:

 <project default="remote">
  <target name="remote">

   <java classname="B" fork="true">
    <classpath>
     <pathelement path="bin" />
    </classpath>
    <jvmarg value="-Xdebug" />
    <jvmarg value="-Xnoagent" />
    <jvmarg value="-Djava.compiler=NONE" />
    <jvmarg
 value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" />
   </java>

  </target>
 </project>

I launched the Ant build outside Eclipse and tried with address=8000.
[...]. Also, since my app takes long to start I connected Eclipse pretty much after starting Ant. It shows some threads and picked up.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号