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?
Eclipse IDE debugging - code not reflects new changes
Asked Answered
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
Its still Not working, I have tried the same operation in Eclipse Neon and Mars2 . Its picking the old complied jars from the target. Not not will automatically at all. Its annoying to clean and build jars again and again even making a small changes. Will look for more suggestion pls. –
Sitzmark
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>
© 2022 - 2024 — McMap. All rights reserved.
Project -> Build Automatically
ticked? And did you save the relevant file before debugging? – ErewhileBuild Automatically
, if not click it one time. – ErewhileProblems
section)? Can you provide a screenshot of your eclipse? – Erewhiletarget/
directory and runs them from there. Is your project a dependency used by a different project? – Erewhile