I've been trying to play around with hotswapping Java code in Eclipse, but I have no idea what the limitations and rules of hotswapping Java code in Eclipse are, so my efforts frequently fail. If anyone could offer a relatively detailed explanation of how to hotswap code in Eclipse or link me to one that would be great.
For instance, this code hotswaps if I change the value of u
:
public class apples extends tuna {
public static void main(String[] args) throws InterruptedException {
while (true) {
ddop();
Thread.sleep(1000);
}
}
public static void ddop() {
int u = 3;
System.out.println(u);
}
}
but this code doesn't:
public class apples extends tuna {
static int u;
public static void main(String[] args) throws InterruptedException {
int u = 3;
while (true) {
System.out.println(u);
Thread.sleep(1000);
}
}
}
Could anyone provide an explanation why? And yes, I do have the "build automatically" flag checked and am running in debug mode.