Java Hotswap 与 Eclipse 以及本地计算机上的远程调试
我正在尝试找出如何在使用我的构建系统进行调试时启用代码热交换,但我却一无所获。
我有一个带有调试目标的 Ant 构建,如下所示:
<target name="debug_dev" depends="compile"
description="Runs development version with the debugger.">
<java classname="applets.TabHandler" fork="true" dir="build">
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" />
<classpath refid="compile_classpath" />
</java>
</target>
然后我使用 Eclipse 中的远程调试选项连接到端口 8000。调试工作正常,但我无法像使用 Ant 之前那样编辑代码。我知道可以在 JBoss、Tomcat 和其他情况下进行热交换,但我只是通过 JVM 调用在本地运行我的程序,正如您从上面看到的那样。
有谁知道我的设置是否可行?
谢谢!
I'm trying to find out how to enable hotswapping of code while debugging with my build system and am coming up dry.
I've got an Ant build with a debug target like so:
<target name="debug_dev" depends="compile"
description="Runs development version with the debugger.">
<java classname="applets.TabHandler" fork="true" dir="build">
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" />
<classpath refid="compile_classpath" />
</java>
</target>
I then use the remote debugging option in Eclipse to connect to port 8000. Debugging works fine, but I cannot edit code like I was able to before I was using Ant. I know that it is possible to get hotswapping working with JBoss, Tomcat, and other situations, but I am just running my program locally with a JVM call, as you can see from above.
Does anyone know if this is possible with my setup?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Java Ant 热插拔工作得相当好。在 Eclipse 中不需要这样做。
http://code.google.com/p/hotswap/
Java Ant hotswap works rather well. There is no need to do it in Eclipse.
http://code.google.com/p/hotswap/
让 Ant 脱离您的调试工作流程。使用 Ant 打包最终产品或持续集成,但对于迭代开发和调试,请直接从 Eclipse 编译和运行代码。这样你就可以进行热插拔等。
Get Ant out of your debugging workflow. Use Ant for packaging final product or continuous integration, but for iterative development and debugging, compile and run code directly from Eclipse. You will get hotswapping, etc. that way.