[SOLVED] Runtime won't register project changes

For some reason, Java runtime won’t register any changes I make in my code. For example, if I add a deliberate, unavoidable exception, the program will run as if the exception didn’t exist. It’s like that for all changes I make to my code. The only way I found to get by the issue is to clean and build before I run the program.

I first noticed the issue when I inadvertently had two instances of the SDK opened at once. :expressionless:
Any idea what’s going on?

it might be related to IDE “compile on save” thing.

Hmm, maybe.
Properties → Build → Compiling → Compile on Save is checked for my project.

The “Compile on Save” thing is usually a different error.

Are you using the built in ancient ANT support or gradle? (I assume SDK but you didn’t say for sure… just that you had a similar problem once when running two of them.)

I’m using ancient ANT.

It could be related to the compile on save… though usually that problem was a weird error that you only get from code compiled with the broken incremental compiler. However, turning off compile on save will force the IDE to run ANT every time you run… and may collaterally fix your other problem.

In my experience, gradle is the only tool that does proper dependency checks and I can get away with essentially never doing a clean build. (Day job, using maven, we do clean builds all the time… and they take 10 minutes… so… painful. But with maven it’s the only way to be sure because it doesn’t do any real dependency management.)

I fiddled around with compile on save with no result. I finally just moved the project’s sources to a new project, which basically dodges the whole issue.

we do clean builds all the time… and they take 10 minutes… so… painful

ouch…

Yeah, my one regret on this project was not switching to gradle 6 years ago when it would have been easier, inherited code or not.

1 Like

Unless you have a specific reason for using Ant, I’d recommend using the Gradle template for (at least, new) projects. Migration is usually painless, and the benefits notable (if not just for dependency handling).

That said, I’ve noticed the SDK sometimes not recognizing some source files altogether (losing “color” scheme, etc). And I’m not sure it’s only for Ant projects, since I haven’t used them for a while.

1 Like