Question

I'm using Eclipse IDE (4.2). When I make a change in Eclipse and try to debug it, the previous version is compiled, but not the new one. To get around this, I do maven clean/build and then refresh the project. But this is very tedious and I need to do it every time I make any changes. Is there another way around this or a plugin that I can use to pick up these changes automatically?

Was it helpful?

Solution

Click Project > Build Automatically once and make sure that tick mark is appeared in front of Build Automatically option.

Also you have to enable hot code replace options. Click Windows > Preferences. Go to Java > Debug select all options in Hot Code Replace group

OTHER TIPS

I had the same problem and these steps fixed it:

  • Run -> Run configurations
  • Select the one giving the problem
  • Go to the Source tab
  • Make sure your project is the first entry there
  • Mine had just the Default set there so I had to do this: Add -> Java Project -> Select your Project and add it

I had the same problem, the reason was a wrong configuration of the javabuilder in the .project managed by Eclipse. I opened it and rewrote the buildspec section so that either Maven or jdt.core can compile. Once done, relaunch Eclipse and if the Project > Build Automatically option is enabled, any change should now be reflected:

<?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
  <name>ProjectName</name>
  <comment>My beautiful project</comment>
  <projects>
  </projects>
  <buildSpec>
    <buildCommand>
        <name>org.eclipse.jdt.core.javabuilder</name>
        <arguments>
        </arguments>
    </buildCommand>
    <buildCommand>
        <name>org.eclipse.m2e.core.maven2Builder</name>
        <arguments>
        </arguments>
    </buildCommand>
  </buildSpec>
  <natures>
    <nature>org.eclipse.m2e.core.maven2Nature</nature>
    <nature>org.eclipse.jdt.core.javanature</nature>
  </natures>
 </projectDescription>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top