Both contain an initializer (instance) block. In the first example you are declaring an instance variable so, that is fine (despite the location of it, well, it is an instance variable). But in the second example, declaration is inside the instance initializer block after the assignment, in which the compiler unable to parse the assignment statement (due to i is not declared at that point anywhere inside the class instance/class variable).
This has nothing to do with forward referencing -- Java just doesn't allow statements (that are not declarations), outside of a constructor, initializer, or method. This is because there is no definition on when these statements will be executed.