Up until I reformatted my computer and reinstalled Windows 8 on it, I have not been able to get Hotswapping working again. It worked fine before, but now it wont react at all. I am running a small segment of code to try it out;

With this I should be able to run it in Debug mode and change the X value to print something else, but it does not seem to work. All my settings in Eclipse is default and I am having "Build Automatically" checked. Is there any more suggestions? Someone on LWJGL IRC said something about the build path but I think everything is OK there too.

You may check if there are any problems with automatic building. First look at the project icon in the project explorer view, if there is a exclamation mark at it then it possibly cannot build automatically. You would have to open the "problems" view in "Window -> Show view -> problems". A window will popup. I've run to such problems several times and its pretty annoying.

I checked the "Problems" window, but there is nothing there it seems. And I do not think I have some exclamation mark if the "Package Explorer" is what you mean.

By default, Eclipse changes entire methods, not individual lines of code. For a replaced method to become effective, it has to be called. This means that when multiple threads are accessing this method, each may be executing its own version of the method.

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

By default, Eclipse changes entire methods, not individual lines of code. For a replaced method to become effective, is has to be called. This means that when multiple threads are accessing this method, each may be executing its own version of the method.

Is there a way to solve it?

Anyhow, figured out something interesting. I set a breakpoint on "System.out.println" and it stopped running the code when it hit it, so I ran it a few times getting the same value of X printed out. I changed the value and then continued to run it, breaking a few times at the breakpoint. This worked though, the X value was showing the changed value.

So I guess it only works if I hit the breakpoints though. Weird, but a clue.

You can change "ctr" to anything you want, and the change will reflect in the output. Adding breakpoints allows the JVM to "refresh" the stack frame. Here's a quote that I think explains why your specific code doesn't work:

Quote

There are some cases where the feature will not work. E.g. if you make changes to your main method's a4 variable, the JVM will not be able to remove all stack frames running old code from the call stack. The debugger data will be lost.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org