Tried your code and got the same result for Eclipse, NetBeans and command line:
before i = 1
before j = 1
i = 3
j = 3
Are you positive the code is the same in Eclipse and NetBeans?