Java Hotswap with Eclipses and Remote Debugging on

2020-07-23 03:39发布

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!

2条回答
欢心
2楼-- · 2020-07-23 03:49

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

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

查看更多
\"骚年 ilove
3楼-- · 2020-07-23 03:51

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.

查看更多
登录 后发表回答