You could have left the declaration inside the initializer and just added the modifier static and it would have worked.
Actually I tried that it didn't work either. Here's the code and the error message.
Compiler output:
illegal start of expression
static int i
^
cannot resolve symbol
System.out.println( "Static code: i = " + i++ );
^
cannot resolve symbol
System.out.println( "main: i = " + i++ );
^
3 errors
Joe