Java Hotswap with Eclipses and Remote Debugging on Local Machine

。_饼干妹妹 提交于 2019-12-06 08:38:15

问题


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!


回答1:


Java Ant hotswap works rather well. There is no need to do it in Eclipse.

http://code.google.com/p/hotswap/




回答2:


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.



来源:https://stackoverflow.com/questions/5476317/java-hotswap-with-eclipses-and-remote-debugging-on-local-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!