eclipse:以编程方式启动进程 [英] eclipse: debug programmatically initiated process

查看:98
本文介绍了eclipse:以编程方式启动进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  Process process = Runtime.getRuntime()我通过eclipse中的另一个java进程以编程方式执行java进程: .exec(command,envp,dir); 

有没有办法告诉eclipse来调试子进程?



或者,我可以通过链接多个启动配置来解决这个问题,即启动过程A,完成启动过程B - 提供B可以在调试模式下启动。

解决方案

如果您在Eclipse中使用远程调试功能,则可以将其指向任何JVM实例。您只需要确保每个实例被告知要使用唯一的JDWP端口。这是你如何从命令行:

  java -Xdebug -Xrunjdwp:transport = dt_socket,address = 8998 ,server = y 

所以,将'地址'部分更改为任何你想要的端口,那么你可以点在该端口的Eclipse。以下是一些更多信息:



http://java.dzone.com/articles/how-debug-remote-java-applicat


I'm programmatically executing a java process via another java process in eclipse:

Process process = Runtime.getRuntime().exec(command, envp, dir);

Is there any way to tell eclipse to debug the child process?

Alternatively, I could solve this by chaining multiple launch configurations, ie launch process A, on completion launch process B - provided B could be launched in debug mode.

解决方案

If you use the "Remote Debug" feature in Eclipse then you can point it at any JVM instance. You just need to make sure that each instance is told to use a unique JDWP port. This is how you'd do it from the command line:

java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y

So, change the 'address' part to whatever port you want, then you can point Eclipse at that port. Here's some more information:

http://java.dzone.com/articles/how-debug-remote-java-applicat

这篇关于eclipse:以编程方式启动进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆